Skip to content

Instantly share code, notes, and snippets.

@weijia
Created October 11, 2014 09:20
Show Gist options
  • Save weijia/062fcc7d561d2d526c7d to your computer and use it in GitHub Desktop.
Save weijia/062fcc7d561d2d526c7d to your computer and use it in GitHub Desktop.
clip_trans camel to lowcase
def convert(name):
import re
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
yl = []
for i in xl:
yl.append(convert(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment