[Tutor] Print Doc Strings

Joseph J. Strout joe@strout.net
Mon, 4 Oct 1999 08:57:34 -0700


> >>>for name in dir(sys):
>...    print name
>
>This prints all the names.  How can I get to the __doc__ strings?

for name in dir(sys):
	item = getattr(sys,name)
	print item.__doc__

(I haven't tried this, but it should work.)

,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'