【发布时间】:2018-02-05 16:12:57
【问题描述】:
由于某种原因,我在包含这段代码的行出现错误:
t1 = threading.Thread(target=socket)
这是错误:
Traceback (most recent call last):
File "D:/04 - Media/Python Projects/4 - Networking/Send_Variable_Test/Server.py", line 33, in <module>
t1 = threading.Thread(target=socket)
AttributeError: 'module' object has no attribute 'Thread'
Exception AttributeError: "'module' object has no attribute '_shutdown'" in <module 'threading' from 'D:\04 - Media\Python Projects\4 - Networking\Send_Variable_Test\threading.pyc'> ignored
从这个错误中可以明显看出线程库中显然没有“线程”模块,这是为什么呢?是我使用 python 2 的原因吗?
【问题讨论】:
标签: python multithreading python-2.7