Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

configparser.py ,raise KeyError(key),KeyError: 'display' #102

Open
zgjssyjw opened this issue May 21, 2021 · 1 comment
Open

configparser.py ,raise KeyError(key),KeyError: 'display' #102

zgjssyjw opened this issue May 21, 2021 · 1 comment

Comments

@zgjssyjw
Copy link

系统版本,包含位数:win10 64位

python版本:3.7.1

软件/源码版本:20210520

浏览器、驱动版本:chrome 89.0.4389.72


全部报错

答:Traceback (most recent call last):
File "d:/Documents/python_code/TechXueXi-20210520/SourcePackages/pandalearning.py", line 45, in
if(cfg['display']['banner'] != "false"): # banner文本直接硬编码,不要放在ini中
File "D:\ProgramData\Anaconda3\envs\xuexi\lib\configparser.py", line 958, in getitem
raise KeyError(key)
KeyError: 'display'

@TCPsoftware
Copy link

找到config/main.ini,检查下有无

; 显示设置。
[display]
; 显示banner (true/false)
banner = true

注意banner前面没有分号

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants