从 Python 程序运行 .exe 时终止后台窗口
以下是调用“demo.exe”文件的 python 程序中的一行。调用 demo.exe 时会打开一个窗口,有什么方法可以让 demo.exe 在“后台”运行吗?也就是说,我不想显示它的窗口,我只想运行 demo.exe。
p = subprocess.Popen(args = "demo.exe", stdout = subprocess.PIPE)
demo.exe 的输出由 python 程序实时使用,因此 demo.exe 不是我可以在运行 python 程序之前运行的东西。 demo.exe 处理大量动态后端计算。我使用的是Windows XP。
提前致谢!
the following is a line from a python program that calls the "demo.exe" file. a window for demo.exe opens when it is called, is there any way for demo.exe to run in the "background"? that is, i don't want the window for it show, i just want demo.exe to run.
p = subprocess.Popen(args = "demo.exe", stdout = subprocess.PIPE)
the output of demo.exe is used by the python program in real time, so demo.exe is not something that i can have run in advance of running the python program. demo.exe handles a lot of on the fly back-end calculations. i'm using windows xp.
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢 另一个 StackOverflow 线程,我认为这就是您所需要的:
我测试过在我的 XP 上的 Python 2.6 上,它确实隐藏了窗口。
Thanks to another StackOverflow thread, I think this is what you need:
I tested on my Python 2.6 on XP and it does indeed hide the window.
试试这个:
Try this: