Created
June 11, 2012 11:05
-
-
Save drakeguan/2909605 to your computer and use it in GitHub Desktop.
man for python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pydoc | |
import sys | |
def usage(): | |
print 'man for python.' | |
print 'Usage: manpy OBJECT' | |
print 'Ex: manpy os.walk' | |
def main(argv = sys.argv[:]): | |
try: | |
pydoc.help.help(argv[1]) | |
except IndexError: | |
usage() | |
return 0 | |
if __name__ == '__main__': | |
sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment