Browse files

Usually it's easier to ask the Python executable for the help I need …

…than go looking for it on Python.org... Now I can do so quickly and easily. I should probably look for something like this that's already built, huh?
  • Loading branch information...
1 parent 857fe4b commit 5e1f507a35bcd36624a860269d12c0dce1b74e77 @al-the-x committed Apr 27, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 bin/pyhelp
View
17 bin/pyhelp
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+import sys
+
+words = sys.argv; words.pop(0)
+
+for word in words:
+ try:
+ try:
+ __import__(word)
+ except ImportError: # not a module...
+ module, _ = word.rsplit('.', 1)
+ __import__(module)
+
+ help(word)
+ except ImportError:
+ print('Cannot find "%s" to import!' % word)
+

0 comments on commit 5e1f507

Please sign in to comment.