NIlesh Meharkar NIlesh Meharkar - 2 years ago 120
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 Source

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

pip install configparser
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download