January 31st, 2005, 05:14 PM
Download from the Internet
Can anyone show me how to do a simple download through Python? Maybe one that won't show any windows, it will download a certain file into a designated directory.
January 31st, 2005, 05:52 PM
The easiest way to do this is to use the urllib/urllib2 modules open() function to read the file from the internet. You can then write this data to a local file like you would any other string.
Note: if the file is binary (an image) you need to use the 'wb' flag when opening your file rather than 'w'.
Hope this helps,