I'm working with tkinter in python and I have an annoying bug that I can't seem to fix, although the answer is probably obvious.
I am trying to call a dictionary with a string, but for some reason I get the error: Type Error: unhashable type: StringVar. Here is a snippet of code with that issue:
from Tkinter import *
gpa = Tk()
weightsy = {'0': 2, '.1': 6, '.25':.2, '.5':.56, '.75':75, '1':12}
acadw = StringVar()
acadw.set(".1")
print (weightsy.get(acadw)) #Here is the issue; it should return the integer 6.
mainloop()
For extra info, if I remove the tkinter related code (such as the import, gpa = Tk(), StringVar, .set, mainloop()) it works, so I believe it is a tkinter related issue.