[Tutor] file fetcher class object through http

Steven D'Aprano steve at pearwood.info
Sat Aug 20 03:59:19 CEST 2011


Artie Ziff wrote:
> Hello..
> 
> I like reading different people's implementations of python as it helps 
> me decide what is necessary vs what is not.
> 
> Essentially, I want to write a class that finds, and downloads a file 
> from a web server.

Such tools already exist, although they may not be written in Python. In 
particular, google on "wget" or "curl" for two very well-known 
industrial-strength tools for downloading files from the web (and other 
places). If you just want something that works, I recommend you learn 
how to use those tools rather than re-inventing the wheel.

(A lot of my scripts that download from the web do text processing in 
Python then call wget for the actual download.)

If you add "python" to your search terms, you may find the sort of code 
you are looking for, or at least examples that will point you in the 
right direction. E.g.:


http://duckduckgo.com/?q=python+wget
http://duckduckgo.com/?q=python+curl



-- 
Steven



More information about the Tutor mailing list