PDA

View Full Version : [SOLVED] How to save remote file in local disk via python ?



prismctg
March 10th, 2012, 03:33 AM
how can i save http://example.com/ex.jpg file in harddisk via python script ?

Tony Flury
March 10th, 2012, 11:43 AM
look at wget - i would use that.

Or maybe the htmllib library if you insist on a pure python (wget is a command line tool).

codemaniac
March 10th, 2012, 11:50 AM
how can i save http://example.com/ex.jpg file in harddisk via python script ?

Something like below all you want ?


import os
print os.system('wget -c http://example.com/ex.jpg')

os.system gives return code of the commnad .

prismctg
March 10th, 2012, 01:27 PM
thnx a lot : codemaniac & Tony Flury :)