|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ping
Hi All
Do any one know how to write a programme in python to ping one or more than one Pc's and print ok to successful no to unsuccessful. An example would be great. Thanks |
|
#2
|
||||
|
||||
|
__________________
*** Experimental Python Markup CGI V2 *** |
|
#3
|
||||
|
||||
|
This link has a Python 1.4 module for ping and traceroute.
http://www.python.org/~jeremy/python.html You may need to do some conversion work. grim ![]() |
|
#4
|
||||
|
||||
|
I coded one not to long ago.. if ya still need it.. let me know and i will look fo it for ya
__________________
IE QUOTE | PHP Manual | Google | C/C++ Compiler | Linux Tutorials | General Stuff Game Dev |
|
#5
|
|||
|
|||
|
HI xlordt
It will be graet if you could post the cade Thanks |
|
#6
|
||||
|
||||
|
Code:
import os
for x in file( "adress.txt" ):
address, ports = x.strip( ).split( ":" )
Ping = os.system( "ping -w 1 -a " + address + " > null.txt" )
if Ping == 1:
print address, "\t[Not Good]"
else:
print address, "\t[Yes Good]"
I hade a better one, but i cant find it.. i know i put it in one of my floopys.. so i will look for that one laters.. this one i coded it at a friends house.. cause im not home.. but if this will do you.. then kool... else let me know and i will look for it when i get home laters good luck, btw this works on windows.. on linux i would use > /dev/null.. dont know if windows has oneLast edited by xlordt : June 4th, 2004 at 10:05 AM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Ping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|