[Tutor] Re: Here is a completed script for everyones perusal.

montana sarmxiii@knology.net
Fri, 13 Sep 2002 18:37:58 -0500


--Apple-Mail-3--34013122
Content-Type: multipart/alternative;
	boundary=Apple-Mail-4--34013122


--Apple-Mail-4--34013122
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

No.  I got it from a download of modules from:

http://diveintopython.org/fr/dialect_extract.html

I've attached it to this email in case it can't be found.

SA

"I can do everything on my Mac I used to do on my PC, plus alot more 
..."
--Me

On Thursday, September 12, 2002, at 05:00 AM, Prahlad Vaidyanathan 
wrote:

> Hi,
>
>     Just noticed one little thing ...
>
> On Tue, 10 Sep 2002 montana spewed into the ether:
> [-- snip --]
>> import urllib, urllister
>
>     Is urllister part of the standard library ? I don't seem to
> have it on my setup here.



--Apple-Mail-4--34013122
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

No.  I got it from a download of modules from:


<fontfamily><param>Lucida Grande</param>http://diveintopython.org/fr/dialect_extract.html


I've attached it to this email in case it can't be found.


SA

</fontfamily>

"I can do everything on my Mac I used to do on my PC, plus alot more
..."

--Me


On Thursday, September 12, 2002, at 05:00 AM, Prahlad Vaidyanathan
wrote:


<excerpt>Hi,


    Just noticed one little thing ...


On Tue, 10 Sep 2002 montana spewed into the ether:

[-- snip --]

<excerpt>import urllib, urllister

</excerpt>

    Is urllister part of the standard library ? I don't seem to

have it on my setup here.

</excerpt>



--Apple-Mail-4--34013122--

--Apple-Mail-3--34013122
Content-Disposition: attachment;
	filename=urllister.py
Content-Transfer-Encoding: quoted-printable
Content-Type: application/octet-stream;
	x-unix-mode=0755;
	name="urllister.py"

"""Extract=20list=20of=20URLs=20in=20a=20web=20page=0D=0A=0D=0AThis=20=
program=20is=20part=20of=20"Dive=20Into=20Python",=20a=20free=20Python=20=
book=20for=0D=0Aexperienced=20programmers.=20=20Visit=20=
http://diveintopython.org/=20for=20the=0D=0Alatest=20version.=0D=0A"""=0D=
=0A=0D=0A__author__=20=3D=20"Mark=20Pilgrim=20(f8dy@diveintopython.org)"=0D=
=0A__version__=20=3D=20"$Revision:=201.1.1.1=20$"=0D=0A__date__=20=3D=20=
"$Date:=202002/02/21=2018:45:44=20$"=0D=0A__copyright__=20=3D=20=
"Copyright=20(c)=202001=20Mark=20Pilgrim"=0D=0A__license__=20=3D=20=
"Python"=0D=0A=0D=0Afrom=20sgmllib=20import=20SGMLParser=0D=0A=0D=0A=
class=20URLLister(SGMLParser):=0D=0A=09def=20reset(self):=0D=0A=09=09=
SGMLParser.reset(self)=0D=0A=09=09self.urls=20=3D=20[]=0D=0A=0D=0A=09def=20=
start_a(self,=20attrs):=0D=0A=09=09href=20=3D=20[v=20for=20k,=20v=20in=20=
attrs=20if=20k=3D=3D'href']=0D=0A=09=09if=20href:=0D=0A=09=09=09=
self.urls.extend(href)=0D=0A=0D=0Aif=20__name__=20=3D=3D=20"__main__":=0D=
=0A=09import=20urllib=0D=0A=09usock=20=3D=20=
urllib.urlopen("http://diveintopython.org/")=0D=0A=09parser=20=3D=20=
URLLister()=0D=0A=09parser.feed(usock.read())=0D=0A=09parser.close()=0D=0A=
=09usock.close()=0D=0A=09for=20url=20in=20parser.urls:=20print=20url=0D=0A=

--Apple-Mail-3--34013122--