try:
    from configparser import ConfigParser
except ImportError:
    from configparser import ConfigParser
config = ConfigParser()
config.readfp(open('desiredFile'))
Read file with "variable=value" (Windows INI) format?