Search code examples
pythonconfigparser

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


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


Solution

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

    pip install configparser