线程执行带有参数的任务
2021-01-22 10:15
标签:任务 inf 技术 print password class int c99 open 执行结果: 线程执行带有参数的任务 标签:任务 inf 技术 print password class int c99 open 原文地址:https://www.cnblogs.com/yujiemeigui/p/14304821.htmlfrom threading import *
from time import *
def show_info(name,age):
print(name,age)
def show_user_info(username,password):
print(username,password)
if __name__ == ‘__main__‘:
t1 = Thread(target=show_info,args=(‘lisa‘,18))
t2 = Thread(target=show_user_info,kwargs={"username": "hw","password": 123456})
t1.start()
t2.start()