学习笔记(44):150讲轻松搞定Python网络爬虫-使用Thread类创建多线程

立即学习:https://edu.csdn.net/course/play/24756/284627?utm_source=blogtoedu

1.查看当前线程的信息:
the_thread=threading.current_thread()

print(the_thread)

print(the_thread.name) #查看名字

#给线程改名字:

在多线程函数下,

th1=threading.Thread(target=线程函数名,name=" ")

2.threading.enumerate()函数当查看前的线程:

多线程函数下:

print(threading.enumerate())

上一篇:PTA 浙大版《C语言程序设计(第3版)》题目集 练习2-4 温度转换


下一篇:学习笔记(12):150讲轻松搞定Python网络爬虫-requests库-发送POST请求