python并发编程-线程模块的其他方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_27695659/article/details/84968286
import time
import threading

def wahaha(n):
    time.sleep(0.5)
    print(n,threading.current_thread(),threading.get_ident())

for i in  range(10):
    threading.Thread(target=wahaha,args=(i,)).start()
print(threading.active_count())    # 10
print(threading.current_thread())
print(threading.enumerate())

猜你喜欢

转载自blog.csdn.net/qq_27695659/article/details/84968286