Created
August 27, 2022 23:20
-
-
Save yumusb/31bbbc9587708fd37425bb5c43309759 to your computer and use it in GitHub Desktop.
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
import sys | |
def httpget(url): | |
if sys.version_info.major == 2: | |
import urllib2 | |
req = urllib2.Request(url) | |
data = urllib2.urlopen(req).read() | |
return data | |
else: | |
import urllib.request | |
data = urllib.request.urlopen(url).read() | |
return data | |
base = "https://bootstrap.pypa.io/pip/" | |
basefilename = "get-pip.py" | |
remoteverpath = ["2.6","2.7","3.2","3.3","3.4","3.5","3.6"] | |
locver = str(sys.version_info.major)+"."+str(sys.version_info.minor) | |
if locver in remoteverpath: | |
url = base + locver + "/" + basefilename | |
else: | |
url = base + basefilename | |
exec(httpget(url)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment