En Fri, 22 Feb 2008 04:11:56 -0200, Manikandan R <[EMAIL PROTECTED]> escribió:
> url = 'http:\\username:[EMAIL PROTECTED]' > urllib.urlopen(url) > > It opens fine when its correct web page else it hangs there.... > So I > have planned to start a timer when i launch the web page, if time > exceeds it > will exit the thread. But I don't know how to do this can U please help > me. Sockets have a .settimeout() method, but it's hard to obtain the socket object used by urlopen *before* the connection attempt. So it may be easier to set a global timeout with socket.setdefaulttimeout(...) The in-development version of urlopen.py has timeout support. You might try to download and use it; probably requires httplib.py and socket.py too. http://svn.python.org/view/python/trunk/Lib/urllib.py?view=markup -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list