蟒蛇 + windows:运行exe,就好像它与当前进程无关一样

发布于 2024-09-15 11:04:22 字数 168 浏览 3 评论 0原文

我知道我可以使用 subprocess.Popen 来运行可执行文件,并可能将标准输入和标准输出重定向到文件/使用管道到我的进程。然而,有没有一种方法可以运行可执行文件,使生成的进程与当前的 Python 进程无关?意思是,我想以与双击 .exe 相同的方式启动一个进程,或者在“开始”->“运行”中输入其名称...

I know I can use subprocess.Popen to run an executable, and potentially redirect stdin and stdout to files / using pipes to my process. Is there a way to run an executable such that the spawned process has no relation to the current Python process, however? Meaning, I want to start a process in the same way as if I would double-click on the .exe, or type in its name into Start->Run...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

筱果果 2024-09-22 11:04:22

在 Windows 上,请参阅 os.startfile()

On Windows, see os.startfile().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文