NIlesh Meharkar NIlesh Meharkar - 7 months ago 13
Python Question

How to read config(.ini) file in python which will work on 2.7 and 3.x python

Should I use

ConfigParser
witch compatible with python 2.7 and 3.x, or do you suggest any other module in python which is compatible for both versions for reading config file?

Answer

You can make use of configparser backport, so it will work on both Python version.

pip install configparser