Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cloning/downloading files via a python script

I was wondering how to clone/download a github file or files via a python script. I cant seem to figure out how to

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

In addition to Maurice Meyer’s method, you can do as follows:

In order to clone an entire git repository, you would use the following command line script:

git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY

Taking that into account, you could have a python script which would execute this command, by using the subprocess library, such as:

import subprocess
subprocess.run(["git", "clone", "https://github.com/YOUR-USERNAME/YOUR-REPOSITORY"])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading