python 开启线程 thread

创建日期: 2024-10-12 18:24 | 作者: 风波 | 浏览次数: 16 | 分类: Python
import time
import threading

def main():
    while True:
        time.sleep(1)
        print("in thread")

t = threading.Thread(target=main, args=())
t.setDaemon(True)
t.start()
16 浏览
8 爬虫
0 评论