configparser - which one?

DL Neil PythonList at DancesWithMice.info
Mon Mar 25 22:58:32 EDT 2019


Dave,


On 26/03/19 1:10 PM, Dave wrote:
> I use Python3 3, and expected learning how to use configparser would be 
> no big deal.  Well!  Seems there is configparser, stdconfigparser, and 
> safeconfigparser, and multiple ways to set the section and entries to 
> the section.  A little confusing.  I want to future-proof may code, so 
> what should I be using?


(with apologies for not answering the question directly)

After striking this problem, I was encouraged to take a look at JSON, 
and thence YAML. Once there, as they say, didn't look back!
- multi-dimensional possibilities, cf .ini
- similarity/correspondence with Python data structures
- convenient PSL
- easily adopted by (power-)users, cf Python code


WebRefs:

- similar Q: 
https://stackoverflow.com/questions/5055042/whats-the-best-practice-using-a-settings-file-in-python

- article: https://martin-thoma.com/configuration-files-in-python/

- similar discussion: 
https://stackoverflow.com/questions/3085029/pros-and-cons-for-different-configuration-formats

-- 
Regards =dn



More information about the Python-list mailing list