运维网's Archiver
论坛
›
Python
› python 3 新改变
心海恋歌
发表于 2017-4-30 13:46:06
python 3 新改变
1.在Python3中的UserDict被移到了collections模块
from UserDict import UserDict
在python2.6下是没有问题的,但是在python3中却出现Import Error
看来是要统一模块名称,涉及collections的东西都统统要放在一起.逐将代码改为from collections import UserDict
页:
[1]
查看完整版本:
python 3 新改变