July 2010
1 post
3 tags
Pyman
This is a Python module documentation reader. It accepts one argument, attempts to load the relevant module and runs help() on the argument.
#!/usr/bin/env python
import sys
if len(sys.argv) is not 2:
sys.stderr.write('Expected as only argument\n')
sys.exit(1)
module_parts = sys.argv[1].split('.')
try:
__import__(module_parts[0])
except:
pass
help(sys.argv[1])
Short and...