Created
March 10, 2017 14:52
-
-
Save perrygeo/b8b6d2bd6ce305bec653f6f9906fe0e9 to your computer and use it in GitHub Desktop.
help() is not helpful. let me google that for you
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
# LMGTFY | |
# For best results, have python autoload it | |
# add to $(sitepackages)/sitecustomize.py | |
# alias sitepackages="python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'" | |
import webbrowser | |
from urllib2 import quote | |
def lmgtfy(x): | |
search = "Python {}".format(x.__name__) | |
url = 'https://www.google.com/?q=' + quote(search.encode('utf-8')) | |
webbrowser.open_new(url) | |
__builtins__['help'] = lmgtfy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment