How to test if connected to the Internet

Matthew Dixon Cowles matt at mondoinfo.com
Mon May 7 19:00:29 EDT 2001


On Mon, 07 May 2001 22:23:04 +0200, Daniel <Daniel.Kinnaer at Advalvas.be> wrote:

>A few days ago, I wrote some code (see post on NNTP) that allowed
>posting a message to a newsgroup.  All goes well if the connection
>with the Internet (to my ISP) is already established, but how can I
>check if there is already a valid connection?

The easiest way is probably to go ahead and attempt the connection and
see what sort of error occurs if the connection isn't up.

>And if there isn't a connection to the ISP, how do I dial in using
>Python code?

I think that most people do that sort of thing using dial-on-demand
software. That is, software that notices the outgoing connection
attempt and dials automatically.

Regards,
Matt



More information about the Python-list mailing list