Reputation: 1
I've a unique situation where I need to print out the help pages for all functions of a given imported module within a script and output it to a file.
import modx
for I in dir(modx):
print help(modx.i)
Printing to stdout for now, will pipe to a file later once I figure out basic problem above.
Upvotes: 0
Views: 41
Reputation: 246
I wrote this to print functions/classes within the itertools module. You can try with your module and check if it works:
#Replace itertools with your module
import itertools
#Replace items with iteritems in case of python 2.x
for name,item in itertools.__dict__.items():
if callable(item):
print("Name: ",name)
print("*~*"*20)
print(item.__doc__)
print("*~*"*20,"\n")
Upvotes: 1