Does the Config file for the ConfigParser have to be named “Config.ini” in order to work?
I want the name to be “1Config.ini” so that it appears at the top of a folder dir.
This is what I have currently
config = ConfigParser.ConfigParser()
config.read(Revision[0:Revision.rfind('\\')] + "\1Config.ini")
Type = config.get("myvars", "Type")
I get this error however when the file and code is named “1Config.ini”
<class 'ConfigParser.NoSectionError'>: No section: 'myvars'
What’s the output of the following? Make sure it’s a valid file name.
Ideally use
os.path.joininstead of concatenating strings:You probably shouldn’t name your variable
Type, becausetypeis a built-in function/module and it’d be confusing.And no, config files can be named anything: