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.
我有一个小的 python 脚本,它使用subprocess. 我想将 stdout 和 stderr 重定向到日志文件和终端。
subprocess
如何才能做到这一点?
您可以使用subprocess.PIPE.
subprocess.PIPE
您可以在此处找到一些示例代码。