import configparser
class GetConfig():
def __init__(self,file):
self.cf = configparser.ConfigParser()
self.cf.read(file)
def getConfigValue(self,section,name):
value = self.cf.get(section,name)
return value
print(GetConfig('test.ini').getConfigValue('config','platformName'))