I'm using config.ini file to store all my configurations.
I need to store a dictionary and a list in the config file and parse it in my main.py file using configparser. Can anyone please tell me how do I go about doing that?
config.ini:
[DEFAULT]
ADMIN = xyz
SOMEDICT = {'v1': 'k1', 'v2': 'k2'}
SOMELIST = [v1, v2]
main.py:
config = configparser.ConfigParser()
config.read('config.ini')
secret_key = config['DEFAULT']['ADMIN']
If there is no way to do this, is config in json format a good option?