如何查看python脚本开启多少个线程
可以使用Python内置的threading模块来查看当前开启的线程数。具体实现代码如下:
import threading
print("当前线程数:", threading.active_count())
threading.active_count()函数可以返回当前线程数。
原文地址: https://www.cveoy.top/t/topic/g6lb 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
可以使用Python内置的threading模块来查看当前开启的线程数。具体实现代码如下:
import threading
print("当前线程数:", threading.active_count())
threading.active_count()函数可以返回当前线程数。
原文地址: https://www.cveoy.top/t/topic/g6lb 著作权归作者所有。请勿转载和采集!