在Python的外部终端上打开.exe

发布于 2025-02-06 05:14:32 字数 211 浏览 2 评论 0原文

我想在外部终端上运行.EXE文件。 使用此代码,我设法运行了.EXE,但是它以同一终端开始,我称之为脚本,

import subprocess
subprocess.call(["C:/Users/Alessandro/Downloads/BOSCH-GLM/BOSCH-GLM/dist/glm50.exe"])

是否可以在外部终端上运行它?

I would like to run a .exe file on external terminal.
With this code I managed to run the .exe but it starts on the same terminal I call the script

import subprocess
subprocess.call(["C:/Users/Alessandro/Downloads/BOSCH-GLM/BOSCH-GLM/dist/glm50.exe"])

Is there a way to run it on external terminal?

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

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

发布评论

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

评论(1

梦里人 2025-02-13 05:14:32

尝试使用subprocess.popen而不是subprocess.call

看看讨论在这里。您可以忽略.communate()调用。

Try using subprocess.Popen instead of subprocess.call.

Take a look at the discussion here. You can ignore the .communicate() call.

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