import threading
import time
class myThread(threading.Thread):
def __init__(self,name):
threading.Thread.__init__(self)
self.name=name
def run(self):
print("thread run()")
def showMess(self):
print("class method:showMess()")
t=myThread('demo')
t.start()
time.sleep(1)
t.showMess()
Pythonスレッドクラスは通常のメソッドを呼び出します
おすすめ
転載: blog.csdn.net/weixin_43873198/article/details/107533838
おすすめ
ランキング