How to prevent the script from stopping before it should

Fredrik Lundh fredrik at pythonware.com
Mon Jan 17 14:14:36 EST 2005


Steve Holden wrote:

> You will need to import the socket module and then call socket.setdefaulttimeout() to ensure that 
> communication with non-responsive servers results in a socket exception that you can trap.

or you can use asynchronous sockets, so your program can keep processing
the sites that do respond at once while it's waiting for the ones that don't.  for
one way to do that, see "Using HTTP to Download Files" here:

    http://effbot.org/zone/effnews-1.htm

(make sure you read the second and third article as well)

</F> 






More information about the Python-list mailing list