Skip to content

Instantly share code, notes, and snippets.

@drakeguan
Created June 11, 2012 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drakeguan/2909605 to your computer and use it in GitHub Desktop.
Save drakeguan/2909605 to your computer and use it in GitHub Desktop.
man for python
#!/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