|

楼主 |
发表于 2020-3-3 09:41:23
|
显示全部楼层
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import const
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import const
File "<frozen importlib._bootstrap>", line 1567, in _find_and_load
File "<frozen importlib._bootstrap>", line 1553, in _find_and_load_unlocked
File "C:\Python33\lib\const.py", line 6, in __setattr__
raise TypeError('常量必须大写')
TypeError: 常量必须大写
>>> import const
>>> const.N = 9
>>> const.N
9
>>>
***************************************************
为什么每次首次执行都会报错,需要重新载入模块 |
|