import threading
class Messanger(threading.Thread):
def run(self):
for _ in range(10):
print(threading.currentThread.getName())
x = Messanger(name="send")
y = Messanger(name="received")
x.start()
y.start()
答案 0 :(得分:0)
只需更改print(threading ....)即可打印(self.getName())