Skip to content

Instantly share code, notes, and snippets.

@bencord0
Created February 11, 2013 11:29
Show Gist options
  • Save bencord0/4753968 to your computer and use it in GitHub Desktop.
Save bencord0/4753968 to your computer and use it in GitHub Desktop.
Bootstrap python basics. Use when installing a fresh python installation (such as pypy) on a system that doesn't come with python. i.e. windows.
import os,
import urllib2
def run_webscript(script_url):
script_file = os.path.basename(script_url)
with urllib2.urlopen(script_url) as u:
with open(script_file, 'w') as s:
s.write(u.read())
execfile(script_file, dict(__file__=script_file))
run_webscript('http://python-distribute.org/distribute_setup.py')
run_webscript('https://raw.github.com/pypa/pip/master/contrib/get-pip.py')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment