configparser - which one?

Dave dboland9 at offilive.com
Mon Mar 25 23:24:26 EDT 2019


On 3/25/19 10:58 PM, DL Neil wrote:
> 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 
> 
> 
Wish I could do that.  Customer wants .ini.  I would need to sell them 
on an alternative.  The issue is human readable - .ini is easier for 
people to understand.

Dave,



More information about the Python-list mailing list