python3没营养的填坑,BUG:AttributeError: 'dict' object has no attribute 'port'
2018-02-02 09:48
1366 查看
版本:3.6.4
配置文件config.py
错误语法
正确语法
原因:取dict的正确方式
配置文件config.py
options = { "port": 8080, "list": ["good", "good", "hand"] }
错误语法
config.options.port
正确语法
config.options["port"]
原因:取dict的正确方式
相关文章推荐
- Python3下AttributeError: 'dict' object has no attribute 'iteritems'的问题分析
- Python3下错误AttributeError: ‘dict’ object has no attribute’iteritems‘的分析与解决
- Python2.X与Python3.X编程代码笔记(1):AttributeError: 'dict' object has no attribute 'iteritems'
- 解决python中问题AttributeError: 'collections.defaultdict' object has no attribute 'iteritems'
- Python3下AttributeError: 'dict' object has no attribute 'iteritems'的问题分析
- python图像处理问题AttributeError: 'NoneType' object has no attribute 'shape'
- Python Matplotlib AttributeError: 'module' object has no attribute 'popall'
- [Python]attributeError:'module' object has no attribute 'dump'
- AttributeError: 'module' object has no attribute 'AF_INET'处理办法——python
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- python大坑:AttributeError: 'module' object has no attribute 'Workbook'
- python错误:AttributeError: 'module' object has no attribute 'setdefaultencoding'问题的解决方法
- AttributeError: module object has no attribute “Series”. Code works in Python
- Python报错之:AttributeError: 'NoneType' object has no attribute 'seq'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- python __def__ Exception AttributeError: "'NoneType' object has no attribute
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- python 提示错误AttributeError: type object 'str' has no attribute '_name_'