How can I add spaces where ever I have capital letters?

John Schroeder jschroed at gmail.com
Thu May 8 21:12:46 EDT 2008


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:

>>> my_class_name = "ModeCommand"
## Do some magic here
>>> my_class_name
'Mode Command'

Anyone know any easy way to do this?  Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080508/6d8765db/attachment.html>


More information about the Python-list mailing list