I have a configuration file (abc.ini)as below
[DEFAULTS]
plus = plus.jpg
[PATHS]
folderPath = None
when I do config["PATHS"]["folder_path"] I am getting an error.
Also, to access a value, we can use config["PATHS"]["folderPath"]
but can't we use config["PATHS"].folderPath
[DEFAULTS]
plus = plus.jpg
[PATHS]
folderPath = None
import configparser config = configparser.ConfigParser() config.read("abc.ini", encoding="utf-8") print(config.sections()) # works ok config["PATHS"].folder_path = path # path is some pathI don't understand whats happening in config["PATHS"].folder_path = path
when I do config["PATHS"]["folder_path"] I am getting an error.
Also, to access a value, we can use config["PATHS"]["folderPath"]
but can't we use config["PATHS"].folderPath