I have this configuration file:
[test]
one: value1
two: value2
This function returns elements, values from the test section of the configuration file, but when I call the function, I return only the first element (one, value1).
def getItemsAvailable(section):
for (item, value) in config.items(section):
return (item, value)
I call getItemsAvailable () with this function:
def test():
item, value = getItemsAvailable('test')
print (item, value)
I assume that I should create a list in the getItemsAvailable () function and return a list to read the values of the test () function, true?
Any suggestions?
Thank!!
source
share