guopengfa
发布于 2020-05-30 / 764 阅读 / 0 评论 / 0 点赞

Python多线程使用(有参和无参)

#无参
import threading
import time

def run():
print("Hello,word!")

da1 = threading.Thread(target=run)
da1.start()
#有参数传递
import threading
import time

def run(n):
print("Hello,word!",n)

da1 = threading.Thread(target=run,args=("t1",))
da1.start()


评论