I'm scripting an install script in python.
How do I download file from ftp in python?
Operating system -- Windows XP - if that makes a difference.
from urllib2 import urlopen
req = urlopen('ftp://ftp.gnu.org/README')
Then you can use req.read()
to load the file content into a variable or do anything else with it, or shutil.copyfileobj
to save the content to a disk without loading it to memory.
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