import re
def addspace(m) :
return ' ' + m.group(0)
strng = "ModeCommand"
newstr = re.sub('[A-Z]',addspace,strng)
print newstr.strip()
On Thu, May 8, 2008 at 9:12 PM, John Schroeder <js******@gmail.comwrote:
I have a string (which I got from the names of my classes) and I would like
to print out my CamelCase classes as titles.
I would like it to do this:
## Do some magic here>>>my_class_name = "ModeCommand"'Mode Command'>>>my_class_name
Anyone know any easy way to do this? Thanks.
--
http://mail.python.org/mailman/listinfo/python-list