[Tutor] How to check online status

Tim Golden mail at timgolden.me.uk
Mon Nov 3 17:08:02 CET 2008


Timmie wrote:
> Dear fellow Pythonistas,
> is it possible to check with Python whether a computer is connected to the
> internet or not?

You've got several options. The simplest, cross-platform
solution is to connect a socket to a known port on a known
server with a timeout and see if it connects. But there
are ping-alike Python modules around if that's really
what you want:

http://www.google.co.uk/search?hl=en&q=python+ping+module

> And how do I make my python scipts that use urllib to recognize the windows
> operating system proxy settings?

http://docs.python.org/howto/urllib2.html

TJG


More information about the Tutor mailing list