Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用os.system('ping 127.0.0.1 -t >> new.txt'). 我能够在new.txt文档中获得 ping 结果。在这样的流输出的情况下,如何同时在命令窗口和文本文件中获取 ping 结果...?
os.system('ping 127.0.0.1 -t >> new.txt')
new.txt
它适用于 os.system('powershell "ping 127.0.0.1 -t | tee ping.txt')