-
-
Save SamuelMarks/8249092 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
from sys import argv, exit | |
if __name__ == '__main__': | |
if len(argv) < 2: | |
print "USAGE: {0} MODULE [SYMBOL]".format(argv[0]) | |
print "Open help() for given module, or given symbol from module" | |
exit(1) | |
module = argv[1] if argv[1] != '.' else '' | |
symbol = argv[2] if len(argv) > 2 else '' | |
if module: | |
exec 'import {0}'.format(module) | |
exec 'subject = {0}'.format(".".join((module, symbol)).strip('.')) | |
help(subject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment