特牛网址导航

Python 进程 守护进程_一碗烈酒的博客-CSDN博客

网友收藏
文章浏览阅读305次。from multiprocessing import Processimport timedef demo_one(): print("start") time.sleep(3) print("end")if __name__ == '__main__': p = Process(target=demo_one) p.daemon = True # 在start之前设置守护进程,子进程会在主进程结束后直接结束,无论子进程是否执行完 p.st.