Testing for Internet Connection
Alex Marandon
invalid at nowhere.invalid.org
Tue Jul 15 05:09:54 EDT 2008
Alexnb wrote:
> I am wondering, is there a simple way to test for Internet connection? If
> not, what is the hard way :p
Trying to fetch the homepage from a few major websites (Yahoo, Google,
etc.)? If all of them are failing, it's very likely that the connection
is down. You can use urllib2 [1] to accomplish that.
[1] <http://docs.python.org/lib/module-urllib2.html>
More information about the Python-list
mailing list