【发布时间】:2020-08-07 20:42:07
【问题描述】:
所以我的 config.ini 在我的下载中,我的 python 文件在我的
D:/Python Code Stuff I did
而config.ini被放置在
C:\Users\karam\Downloads\Vector_1.3\Vector_1.3\settings.ini
当我尝试这段代码时
config = ConfigParser()
path = os.path.dirname(os.path.abspath(__file__))
configPath = os.path.join(path, "settings.ini")
print(config.sections())
config.read('settings.ini')
我收到的错误是
C:\Users\karam>D:/y/python.exe "d:/Python Code stuff I did/print.py"
[]
【问题讨论】:
-
错误在哪里?
-
C:\Users\karam>D:/y/python.exe "d:/Python Code stuff I did/print.py" []