python多線程-共享全局變量

多線程-共享全局變量 from threading import Thread import time g_num = 100 def work1(): global g_num for i in range(3): g_num += 1 print("----in work1, g_num is %d---"%g_num) def work2()
相關文章
相關標籤/搜索