【发布时间】:2021-10-23 21:37:17
【问题描述】:
我正在编写一个 Texteditor 类:
from threading import *
class Editor(Thread):
{python code}
if __name__ == "__main__":
editor = Editor()
editor.start()
我希望这个编辑器线程作为守护进程运行。我怎样才能做到这一点? 我试过了:
editor = Editor(daemon=True)
editor.daemon = True
self.daemon = True
您好, 戴夫
【问题讨论】:
标签: python multithreading daemon