[Tutor] all methods in a module
Johan Meskens CS3 jmcs3
johanmeskenscs3 at chromaticspaceandworld.com
Fri May 27 14:20:10 CEST 2005
Johan Meskens CS3 jmcs3 wrote:
> hello
>
> >>> import random
> >>> print random.setstate.__doc__
> Restore internal state from object returned by getstate().
>
>
> my question is
> " how can i loop through all the methods in a module
> and print out their '__doc__' content ?
>
> >>> for d in dir( random ):
> print random.???d???.__doc__
>>> for d in dir( random ):
print getattr( random, d ).__doc__
>
> thanks
> jmcs3
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
More information about the Tutor
mailing list