![](/img/trans.png)
[英]ConfigParser.MissingSectionHeaderError when reading config file Python
[英]Pylint throwing configparser.MissingSectionHeaderError:
我正在使用 pylint 測試 python 文件
代碼如下
""" Testing the file inside the content"""
import json
file = r'test.txt'
with open(file,'r') as fr:
fd = fr.read()
print (fd)
下面是測試命令
pylint code.py
錯誤如下
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\ayshewew\\.pylintrc', line: 2
'import json\n'
我已經在 jupyter notebook 中執行了上面的代碼並且工作正常
我的 pylint 是最新版本
試過了
python -m pylint code.py
得到了 output
在職的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.