Created
November 4, 2014 16:23
-
-
Save Seanny123/0dca51294a7f4f28f422 to your computer and use it in GitHub Desktop.
How to get the link for the most recent version of Anaconda
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 urllib, urlparse | |
import re | |
from bs4 import BeautifulSoup | |
# Because I want pretty dict initialization | |
class Vividict(dict): | |
def __missing__(self, key): | |
value = self[key] = type(self)() | |
return value | |
# Use http://repo.continuum.io/anaconda3/ if you want Python3, but for now we're going to use Python2 | |
soup = BeautifulSoup(urllib.urlopen("http://repo.continuum.io/archive/").read()) | |
most_recent_version = re.search(r"[0-9]+\.[0-9]+\.[0-9]+", soup.find_all('a')[-1].text).group(0) | |
# Where to get the various packages | |
anaconda_list = Vividict() | |
anaconda_list["os_x"]["64_bit"] = ("http://repo.continuum.io/archive/Anaconda-%s-MacOSX-x86_64.pkg" %most_recent_version) | |
anaconda_list["linux"]["32_bit"] = ("http://repo.continuum.io/archive/Anaconda-%s-Linux-x86.sh" %most_recent_version) | |
anaconda_list["linux"]["64_bit"] = ("http://repo.continuum.io/archive/Anaconda-%s-Linux-x86_64.sh" %most_recent_version) | |
anaconda_list["windows"]["32_bit"] = ("http://repo.continuum.io/archive/Anaconda-%s-Windows-x86.exe" %most_recent_version) | |
anaconda_list["windows"]["64_bit"] = ("http://repo.continuum.io/archive/Anaconda-%s-Windows-x86_64.exe" %most_recent_version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment