【发布时间】:2012-08-10 08:09:48
【问题描述】:
我对 python 比较陌生,到目前为止我只了解了编程的表面,这就是我对守护进程感到困惑的原因。我通常知道他们做什么,但我不确定在 python 中实现它们的最佳方法是什么。我找到了this 链接,它演示了如何在 python 中创建守护进程。但是,我想知道这是否
#!/usr/bin/env python3.2
import threading
class Update(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
pass #something you want to run in the background
continous = Update
continous.daemon = True
continous.start()
会同样有效吗?
【问题讨论】:
-
在问题中包含您所指的链接。
-
哎呀,对不起。我刚才加进去了
标签: python daemon background-process daemons