简体   繁体   English

如何在没有 pythonw.exe 的情况下将 Python 脚本置于后台?

[英]How to put a Python script in the background without pythonw.exe?

I'm fairly new to Python and I have a python script that I would like to ultimately convert to a Windows executable (which I already know how to do).我对 Python 还很陌生,我有一个 Python 脚本,我想最终将其转换为 Windows 可执行文件(我已经知道该怎么做)。 Is there a way I can write something in the script that would make it run as a background process in Windows instead of being visible in the foreground?有没有一种方法可以在脚本中编写一些内容使其在 Windows 中作为后台进程运行,而不是在前台可见?

You can always run a Windows program in the background using您始终可以使用以下命令在后台运行 Windows 程序

START /B program

See this post for more information.有关更多信息,请参阅此帖子

您可以使用pythonw而不是python运行文件意味着运行命令pythonw myscript.py而不是python myscript.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM