ping

david brochu jr brochu121 at gmail.com
Fri Apr 14 18:30:03 EDT 2006


I am trying to ping websites and output the results to a txt file:


import os

file = open("c:\python24\scripts\ip.txt")
redirect = open("c:\python24\scripts\log.txt","a")

for x in file:
 ping = "ping " + x
 print >> redirect, os.system(ping)


but the results seen in the log.txt file are:

0
0
0
0
0
0
0
0



What am i doing wrong?? How do I fix this so I can see the ping statistics
inside the log.txt file?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060414/412179e0/attachment.html>


More information about the Python-list mailing list