python中多线程的使用

xiaoxiao2021-02-28  91

建议使用import threading它进行了兼容处理

方法一:

   def say(world):

        print(world)

t = thread.Thread(target=say,args=["nice"])

t.start()

方法二:

 class MyThread(threading.Thread):

         def run(self):

              print("......run....")

t = MyThread()

t.start()

转载请注明原文地址: https://www.6miu.com/read-62147.html

最新回复(0)