If you want to use a repo that needs to be installed, I'm not sure how you want to automate the installation inside another python script (also what to do if the installation does not work).
However, if you just want to use some methods from another file, you can download this file and then import it:
import urllib2 def download(url): filename = url.split('/')[-1] print 'Downloading', filename f = urllib2.urlopen(url) data = f.read() f.close() with open(filename, 'w') as myfile: myfile.write(data) # get repository download('https://raw.githubusercontent.com/biryani/Quacpy/master/auxfun.py') # try to import something from it from auxfun import qregnorm q = qregnorm([0, 1, 2]) print 'Success! q =', q
Perhaps you can even download the entire zip code, unzip it, and then import the files.
adrianus
source share