I'm trying to use configParser to upload .ini files. Everything is working well, until I get to a nested loop. I'm trying to find key values in each file, then in each section in that file, and print out the key-pair values.
for i in iniFiles:
config.read(i)
for j in config.sections():
if config.has_option(j, description):
print(j + ':', config[j][description])
In the example, iniFiles
is a list of strings that contain paths to each file I'm trying to look through. description
is the key that I'm trying to search for. I keep looping through a few different files and for whatever reason, one of the files keeps getting repeated when I print out their key-values. Why is that?