pythonpingcommand-windowstream-operators

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


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...?


Solution

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