By system, I expect you mean command line.
if you modify the python script like:
now you can run python getfile/py 'url' 'saveas' from the system command line and also be able to call it from
inside another python program by importing getfile, and calling get_file directly
example:
if you modify the python script like:
import requests import sys def get_file(url, savefile=None, mode='w'): response = requests.get(url) if response.status_code == 200: if savefile: with open(savefile, mode) as fp: fp.write(response.content) if __name__ == '__main__': url = sys.argv[1] save = sys.argv[2] get_file(url, save, 'wb')save it as getfile.py
now you can run python getfile/py 'url' 'saveas' from the system command line and also be able to call it from
inside another python program by importing getfile, and calling get_file directly
example:
python getfile.py 'https://drive.google.com/uc?export=download&id=19LJ6Otr9p_stY5MLeEfRnA-jD8xXvK3m' pink.exeit will do what you want. for any url and any save name