2024-03-28 13:05:27 发布
网友
我有一个python脚本,应该在后台运行。我使用pyinstaller为脚本创建了一个可执行文件。现在,这个文件打开了一个终端窗口。我没有任何要打印在终端窗口上的内容,所以我希望它在启动进程后立即关闭。我该怎么做?现在我有一个这样的连续循环:
pyinstaller
while True: myFunction() time.sleep(some-arbitrary-timeout-value)
根据给定的上下文,我将在此处为您提供几个选项供您选择:
python pyinstaller.py noconsole yourscript.py
nohup python your_executable.py &
pythonw test.py
您可以通过以下方式启动脚本并将其与终端控制台分离:
根据给定的上下文,我将在此处为您提供几个选项供您选择:
python pyinstaller.py noconsole yourscript.py
执行文件时,您将看不到控制台窗口李>nohup python your_executable.py &
即使关闭终端,也会保持脚本运行pythonw test.py
类似于nohup,works on windows您可以通过以下方式启动脚本并将其与终端控制台分离:
nohup python your_executable.py &
相关问题 更多 >
编程相关推荐