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?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to