checking an ip

Ian Weeks i.weeks at home.nl
Wed Sep 13 16:03:30 CEST 2000


I would like to know how to see if a certain IP is active. I want to login
using the ftplib module, but when the given IP number does not exist, it
just hangs, or waits for a long time to timeout. Ping has the same problem.
So what I need is a way to say:

# Some pseudo code
ftp = FTP('xxx.xxx.xxx.xxx', timeout='3')

so, if the connection isn't established in 3 seconds, an exception is
raised, or ftp gets value 0.

I guess there is a way to do this, but how? Can anyone help me out?


Ian Weeks

--
Linux is like a wigwam... no windows, no gates, and apache inside





More information about the Python-list mailing list