gpt4 book ai didi

python - 用 Python 打开一个终端,但让它继续运行

转载 作者:行者123 更新时间:2023-12-04 19:26:36 24 4
gpt4 key购买 nike

我正在使用 zeroc 开发一个分布式应用程序,并启动我们制作脚本所需的所有服务器。
要执行的命令之一是icegridregistry --Ice.Config=registry.conf所以在脚本中它显示为 os.system("gnome-terminal -- icegridregistry --Ice.Config=./iceflix/registry.conf")它可以工作,但我需要打开并激活终端窗口,而不是在执行命令时关闭。

最佳答案

您应该使用 --Ice.Nohup 选项。
语法:Ice.Nohup=num

If num is set to a value larger than zero, the C++ classes Ice::Application and Ice::Service ignore SIGHUP (for UNIX) and CTRL_LOGOFF_EVENT (for Windows). As a result, an application that sets Ice.Nohup continues to run if the user that started the application logs off. The default value for Ice::Application is 0, and the default value for Ice::Service is 1 (C++ only.)


根据 documentation .

关于python - 用 Python 打开一个终端,但让它继续运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70308288/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com