I would like store some configuration data in a config file. Here’s a sample section:
[URLs]
Google, www.google.com
Hotmail, www.hotmail.com
Yahoo, www.yahoo.com
Is it possible to read this into a list of tuples using the ConfigParser module? If not, what do I use?
Can you change the separator from comma (
,) to a semicolon (:) or use the equals (=) sign? In that caseConfigParserwill automatically do it for you.For e.g. I parsed your sample data after changing the comma to equals: