Last active
August 29, 2015 13:56
-
-
Save henryiii/9011826 to your computer and use it in GitHub Desktop.
installsimpy
This file contains hidden or 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
# Install SimPy | |
import urllib | |
import tarfile | |
import shutil | |
import console | |
import os | |
name = 'sympy' | |
version = '0.7.5' | |
# It is easy to install any pypi pure python package, for example: | |
# name = 'simpy' | |
# version = '3.0.2' | |
fullname = name+'-'+version | |
print 'Downloading '+name+'...' | |
url = 'https://pypi.python.org/packages/source/s/'+name+'/'+fullname+'.tar.gz' | |
urllib.urlretrieve(url, 'packget.tar.gz') | |
print 'Extracting...' | |
t = tarfile.open('packget.tar.gz') | |
t.extractall() | |
if os.path.isdir(name): | |
shutil.rmtree(name) | |
shutil.move(fullname+'/'+name, './'+name) | |
print 'Cleaning up...' | |
shutil.rmtree(fullname) | |
os.remove('packget.tar.gz') | |
print 'Done.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sympy 0.7.4.1 is now a builtin module in Pythonista 1.5.