
May 11th, 2004, 03:08 AM
|
|
|
Redirect the output of ping to nul.
Code:
from os import *
if system('ping -n 1 -w 512 ip here > nul') < 1:
print 'good'
else:
print 'bad'
(or /dev/null on linux)
Though, your last post in the other thread looked like it should work. You need to be a bit more careful with ping - if you are testing remote sites, they might have a firewall or ISP which blocks ping requests.
|