Equivalent of 'wget' for python?

saju.pillai at gmail.com saju.pillai at gmail.com
Thu Dec 11 05:36:02 EST 2008


On Dec 11, 2:36 pm, hrishy <hris... at yahoo.co.uk> wrote:
> Hi
>
> Please excuse my OOP but is my understanding correct
>
> urllib.urlretrieve(url_of_zip_file,destination_on_local_filesystem)
>
> is urllib --->Static Class on which the method urlretrieve method is invoked ?

No urllib is a "method". Use type(obj) to find out what python thinks
the "type" of that object is. Note that "object" here is not meant in
the same sense as the OOP definition.

>
> In that case what does the python 3.0 version mean
>
> import urllib.request
> urllib.request.urlretrieve(url, local_file_name)
>
> urllib -->static class
> request -->method
> urlretrieve--> what is this then ?

A 'function'. urllib.request.urlretrieve is the fully qualified name
of the function urlretrieve. In other words urlretrieve lives in the
urllib.request namespace.

-srp

>
> regards
> Hrishy
>
> --- On Mon, 8/12/08, Jerry Hill <malaclyp... at gmail.com> wrote:
>
> > From: Jerry Hill <malaclyp... at gmail.com>
> > Subject: Re: Equivalent of 'wget' for python?
> > To: python-l... at python.org
> > Date: Monday, 8 December, 2008, 5:54 PM
> > On Mon, Dec 8, 2008 at 11:53 AM, r0g
> > <aioe.... at technicalbloke.com> wrote:
> > > urllib.urlretrieve(url_of_zip_file,
> > destination_on_local_filesystem).
>
> > In python 3.0, that appears to be:
>
> > import urllib.request
> > urllib.request.urlretrieve(url, local_file_name)
>
> > --
> > Jerry
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
>




More information about the Python-list mailing list