import json with open('config.json') as jsonFile: YoConfig = json.load(jsonFile) jsonFile.close() #print(YoConfig['db']['choozmo_new']['MYSQL_PASSWORD'])