python進階之多線程對同一個全局變量的處理

一般狀況下:python from threading import Thread global_num = 0 def func1(): global global_num for i in range(1000000): global_num += 1 print('---------func1:global_num=%s--------'%global_num) def fu
相關文章
相關標籤/搜索