How to get stream output in command window and text document simultaneously

169 Views Asked by At

Using os.system('ping 127.0.0.1 -t >> new.txt'). I am able to get the ping result in new.txt document. How to get the ping result in command window and text file at the same time in case of stream output like this...?

1

There are 1 best solutions below

0
Gowthami Sure On BEST ANSWER

It works with os.system('powershell "ping 127.0.0.1 -t | tee ping.txt')