Python 3与PID连接到运行过程
我有一些使用subprocess.popen执行命令,脚本等的代码。如果父母python脚本意外结束,我一直在寻找一种重新构成基础过程的方法,以继续监视它。我们在Linux和Windows上都运行此代码。我们将拥有PID,我们将尝试重新构成该过程,这是启动该过程的用户。
I have some code that uses subprocess.Popen to execute a command, script, etc. I have been looking for a way to reattach to the underlying process to continue monitoring it if the parent python script ended unexpectedly. We have this code running on both Linux and Windows. We would have the PID and we would be trying to reattach to the process as the same user that started the process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论