<div>I am trying to ping websites and output the results to a txt file:</div>
<div> </div>
<div>
<p>import os</p>
<p>file = open("c:\python24\scripts\ip.txt")<br>redirect = open("c:\python24\scripts\log.txt","a")</p>
<p>for x in file:<br> ping = "ping " + x<br> print >> redirect, os.system(ping)<br> <br></p>
<p>but the results seen in the log.txt file are:</p>
<p>0<br>0<br>0<br>0<br>0<br>0<br>0<br>0<br></p>
<p> </p>
<p>What am i doing wrong?? How do I fix this so I can see the ping statistics inside the log.txt file?</p></div>