searching for __doc__ from the interactive cmd line
Rikard Bosnjakovic
bos at hack.org
Thu May 17 06:50:08 EDT 2001
Sean Montgomery wrote:
> Doh! That's a great start.
Before I new about the pydoc, I did this hack:
------cut---------
def print_doc(obj):
for k in dir(obj):
print k
print
try:
print getattr(obj, k).__doc__
except AttributeError:
print "--no-doc--"
print "-" * 70
if __name__ == "__main__":
for t in ["", [], {}]:
print type(t)
print
print_doc(t)
print "=" * 70
------cut---------
--
Rikard Bosnjakovic - http://bos.hack.org/cv/ - ICQ: 1158217
Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.
More information about the Python-list
mailing list