I’m creating my first Python application (PyGTK) and will use a conf file. In that will I will have a section containing a general section with the option of the other sections like this:
[profile]
shares = share1, share2, abc234, kallebengtsson
[share1]
username = daniel
I want to separate that “shares” option and do a foreach of them:
foreach shares:
print username
How would I do that? In PHP I would do this as an array, but I’m uncertain about Python.
I’m using ConfigParser using this guide: http://www.doughellmann.com/PyMOTW/ConfigParser/
And this is my code: https://github.com/danielholm/BareShare/blob/master/bareshare.py
You probably need something like this: