Bob Gailer wrote:
>> 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__
>
>
> The prior responses use dir(), requiring then the use of eval() to get
> the ob
At 04:46 AM 5/27/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
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 ?
>
>
fo
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
Hi!
I've the following solution:
>>> for d in [ "random." + d for d in dir(random)]:
... if callable( eval(d) ):
... print "%30s :\n\n %s" % ( d, eval( "%s.__doc__" % ( d)))
...
random.Random :
Random number generator base class used by bound module function
Johan Meskens CS3 jmcs3 wrote:
> 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__
print getattr(random, d).__doc__
in general you should be prepared
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_