def camel_to_underscore(string):
"""
Convert a CamelCased string into an underscored one
Usage :
>>> camel_to_underscore("ThisIsATest")
this_is_a_test
"""
list_string = []
for c in string[1:]:
if c.isupper():
list_string.append("_" + c.lower())
else:
list_string.append(c)
return string[0].lower() + ''.join(list_string)