Hey all,

I'm trying to recreate the 'help' on various modules that are available. So 
far, I have a bit of code and it seems to be working for the most part. I can 
get the modules available but I also want to be able to print the information 
that is available for each module.

Current output:
['__add__', '__class__', '__contains__', ... 'partition', 'replace', 'rfind', 
'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 
'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
str(object) -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Desired result:
['__add__', '__class__', '__contains__', ... 'partition', 'replace', 'rfind', 
'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 
'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']

atof(s):
Return the floating point number represented by the st
atof(s) -> float

I'm close (I think) but I just can figure out how to grab that part of the 
documentation. Any advice?


Code:
import os
import string
import inspect

def getDirName():
    modList = []
    manPage = 'string'       #used as a place holder for now...           
    cwd = dir(manPage)
    print cwd
    info = inspect.getdoc(cwd[35])          
    print info
    return

if __name__ == '__main__':
    getDirName()

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to