I have a dict (IDMapping) that I'm looking up to in order to get a value, which I am then using to lookup to another dict (defaultFood). I'm having trouble.
My code currently looks like this:
homePSDpath = os.curdir foodName = re.search(r'([a-zA-Z_]+)\\food', homeFoodpath).group(1) foodName = foodName.decode("utf-8") myFoodKey = IDMapping.get(foodName) print defaultFood.get(myFoodKey)
This results in: TypeError: unhashable type: 'list'
I have tried converting foodName to a tuple prior to using it to look up to the IDMapping, but this results in FALSE:
myFoodKey = tuple(myFoodKey)
I'm sure I'm doing something silly here. Thanks everyone.