socket模块导入报错

来源:互联网 发布:基于php的物流管理系统 编辑:程序博客网 时间:2024/05/21 14:53

在导入socket模块后报错:

AttributeError: ‘module’ object has no attribute ‘AF_INET’

因为用import导入模块是根据文件名字导入的,在学习的时候这正好用socket来命名了这个 .py  文件,导致错误的出现。

尽量避免自己写的py文件和模块名字相同

原创粉丝点击