how to download internet files by python ?

iMath redstone-cold at 163.com
Thu Jan 10 03:08:24 CET 2013


在 2013年1月8日星期二UTC+8下午1时04分54秒,Roy Smith写道:
> In article <mailman.259.1357620254.2939.python-list at python.org>,
> 
>  Cameron Simpson <cs at zip.com.au> wrote:
> 
> 
> 
> > On 07Jan2013 20:19, iMath <redstone-cold at 163.com> wrote:
> 
> > | for example ,if I want to download this file ,how to implement the download 
> 
> > | functionality by python ?
> 
> > | 
> 
> > | http://down.51voa.com/201208/se-ed-foreign-students-friends-16aug12.mp3
> 
> > | 
> 
> > | as for  download speed ,of course ,the fast ,the better ,so how to 
> 
> > | implement it ?
> 
> > | It would be better to show me an example :) thanks !!!
> 
> > 
> 
> > Look at urllib2.
> 
> 
> 
> Even better, look at requests 
> 
> (http://docs.python-requests.org/en/latest/).  There's nothing you can 
> 
> do with requests that you can't do with urllib2, but the interface is a 
> 
> whole lot easier to work with.

There is also a httplib2 module 
https://code.google.com/p/httplib2/

which one is more pythonic and powerful ?



More information about the Python-list mailing list