0
点赞
收藏
分享

微信扫一扫

python web03-08-多线程共享全局变量-2(线程传递变量方法)

单调先生 2022-01-20 阅读 46

python web03-08-多线程共享全局变量-2(线程传递变量方法)

调用线程时,传递变量到函数中的方法 : threading.Thread(target=test1, args=(g_nums,))

import threading
import time

def test1(temp):
    temp.append(33)
    print("-----in test1 temp=%s----" % str(temp
举报

相关推荐

0 条评论