urllib.request.urlretrieve ("http://bogoroditsa.tk/Grant's%20Libraries/", "ExtraFunctionality.py")
How do I specify, using the command above, the file path in which to download the file? Currently, the code above just downloads the file in the same path as the program is being run in. I would like to specify this download path, how do I do so?
Instead of just "ExtraFunctionality.py"
you can also provide a full path:
urllib.request.urlretrieve ("http://bogoroditsa.tk/Grant's%20Libraries/",
"/home/foo/ExtraFunctionality.py")
The second argument is the local filename:
urllib.urlretrieve ("http://bogoroditsa.tk/Grant's%20Libraries/ExtraFunctionality.py", theLocalFilename)
For details, see the documentation for urllib, under urlretrieve:
The second argument, if present, specifies the file location to copy to (if absent, the location will be a tempfile with a generated name).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With