php Yaconf can read .ini file
a=123
b=45
c.e.f=987
output like
['a' => 123]
['b' => 45]
['c' =>['e'=>['f'=>987]]]
can python read like this?
thx
Hi, All, May be I did not describe the question well, Sorry for that
Firstly, I did tried configparser, which just parse config key=value
.
But I would have config like a.b.c=value
, e.g:
[cache]
redis.master.host='10.10.10.10'
redis.master.port='6379'
redis.master.auth='xxxx'
redis.slave_1.host='10.10.10.12'
redis.slave_1.port='6389'
redis.slave_1.auth='xxxx'
So, I would read config like
cfger.get('cache', 'redis')
and hope get result like
{'redis': {
'master': {
'host': '10.10.10.10',
'port': '6379',
'auth': 'xxxx',
},
'slave_1': {
'host': '10.10.10.12',
'port': '6389',
'auth': 'xxxx',
},
}
}
Hope you can know what I said