On 11/6/07, Wesley Brooks ([EMAIL PROTECTED]) 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
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to