How to test if connected to the Internet

Steve Holden sholden at holdenweb.com
Mon May 7 18:29:24 EDT 2001


"Daniel" <Daniel.Kinnaer at Advalvas.be> wrote in message
news:5c0eftcig5nrd25kr2leac9gkdpa2p69r6 at 4ax.com...
>
> Hi,
>
> 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? And if there isn't a
> connection to the ISP, how do I dial in using Python code?
>
>  I have tried http://py-howto.sourceforge.net/sockets/node6.html but
> don't seem to get anywhere...
>
> Is there some (easy) example code available which lets me check if a
> connection to the Internet is established or not?  If not, how can I
> dial-in to my ISP using Python?
>
Search Google for "timeoutsocket" - Timothy O'Malley's very useful package
can help here.

regards
 Steve





More information about the Python-list mailing list