'Why is configobj returning a list of strings without their values?
I am trying to read an ini file into a nested dictionary (section->attribute->value), but when I try to use configobj to read it and use a for loop to print that object's values I just get a list of strings of the sections without any of their values when I want a dictionary with that string as the key and the values from the file as the keys' values.
self._myConfigObj = configobj.ConfigObj(infile=myIniFile)
The loop I am using to print its contents
for x in self._supervisorConfigObj:
print(x)
The output of that loop looks like
Section1
Section2
The structure of my ini file is just
[Section1]
Attribute1 = value
With multiple sections and values in each.
**Edit: Ok accessing a section manually and printing that print(self._muConfigObj['Section1'])shows the values so they are there and it's just a matter of accessing it incorrectly. **
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
