Threads in python?
Gerhard Häring
gerhard at bigfoot.de
Mon Feb 25 09:19:11 EST 2002
Fernando Rodríguez wrote in comp.lang.python:
>
> I'm going to start coding a little utility that needs to retrieve webpages and
> process them.
You might find linkchecker a good model for your program.
http://linkchecker.sourceforge.net/
> However, I worried that the whole app might stall if one server takes too long
> to respond or is offline.
You'll need to set a timeout for the sockets then.
http://www.timo-tasi.org/python/timeoutsocket.py
> Does Python support threads? "Learning Python" doesn't mention it...
Sure Python does support threads. Again, linkchecker uses threads, so
it might be worth looking at its code.
Gerhard
--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
More information about the Python-list
mailing list