摘要:
def func(): if not hasattr(func, '_value'): func._value = 0 # 初始化“静态局部变量”_value func._value += 1 print(func._value) # 测试 for i in range(10): func() 阅读全文
posted @ 2020-02-23 01:31
名字下次再取
阅读(303)
评论(0)
推荐(0)
摘要:
1 import threading 2 import time 3 4 5 class MyThread(threading.Thread): 6 semaphore_run = threading.Semaphore(100) # 最多同时运行100个线程 7 8 def start(self) 阅读全文
posted @ 2020-02-23 01:08
名字下次再取
阅读(475)
评论(0)
推荐(0)
浙公网安备 33010602011771号