[Tutor] visualizing code structure / flow charting

Scott SA pydev at rscorp.ab.ca
Tue Nov 6 17:31:17 CET 2007


On 11/6/07, Wesley Brooks (wesbrooks at gmail.com) wrote:

>Taking both one step further if you can extract all the __doc__
>strings for all the objects listed from the dir of an object:
>
>a = 'a random string'
>for i in dir(a):
>    command = "print str." + i + ".__doc__"
>    exec(command)
>
>This will print out all the __doc__ strings for functions you can call
>on your string object a. This is particually helpful when you know
>what you want to do to something (for instance capitalise the first
>letter each word in a string) but don't know what function to call.

While not as educational from one perspective, I've found the epydoc package quite useful. It extracts all of the doc strings and formats them in a nice, easy to read, layout.

    <http://epydoc.sourceforge.net/>

Scott


More information about the Tutor mailing list