I have a configuration file in JSON format. This file is converted into a Python (3.8) Dict named config, which is a global variable. When I try to get the value from any of the keys and attempt to store them in a a variable called test I get the following error: 'NameError: name 'apiResponseOrder' is not defined'
I verified that the config variable is in fact a dict. (type check returns <class 'dict'>)
I am able to loop through the dict and print all the key-value pairs.
The for loop prints values for the following keys: inputDir, outputDir, apiResponseOrder
def processHiscoreItem():
print(type(config))
for key, value in config.items():
print(key)
print(value)
test = config.get(apiResponseOrder)
print(test)
What is going wrong here? Why can I print the values of the keys, but cannot store them in the test variable?