Hi Guys,
I am new to python and I am trying to print ouput of Popen on my text screen (tkinter gui).
I was able to make it work on Linux with this code:
Linux: Working
def PrintSomething2():
outputdata = commands.getstatusoutput("sudo fping -f host.list")
for i in outputdata:
print i
sp.call(["rm", "host.list"])
However, I am trying to do the same for a windows machine but it is not working:
Windows: NOT Working
import subprocess as sp
from subprocess import Popen
import sys
import commands
def PrintSomething2():
outputdata = Popen("scanping.bat")
for i in outputdata:
print i
deletefile = Popen("DEL", "sites.txt")
Note: It is printing in my terminal though:
Let me know if you have any tips. Thanks in advanced!