我在shell脚本上有一个这样写的脚本
function test1(){ command1 };
function test2(){ command2 };
function test3(){ command3 };
我使用shell脚本上的&
来运行那些daemonized writing test1 & test2 & test3
函数
但是我想在Python上做同样的事情。有没有一种方法可以使用任何python内置函数而不使用“daemonize”库?你知道吗
编辑:我想我应该写得更好。我现在知道“背景”是这个问题的更好的词了。我的意图是将我读到的here与python命令结合起来,使某些东西像daemonized一样。 tripleeecomment已经帮我回答了。你知道吗
感谢所有留言的人,并对错误表示歉意。你知道吗
因为我没有足够的声誉,所以我不能给分或添加评论。你知道吗
Python^{} module 允许您同时运行多个进程,就像shell的后台作业一样。你知道吗
。。。其中
test1
、example2
和demo3
是希望与主/父进程同时运行的Python函数。你知道吗如果不想并行运行Python代码,
subprocess.Popen()
将创建一个进程,独立于Python程序运行外部命令。你知道吗相关问题 更多 >
编程相关推荐