I have a dictionary that contains tkinter labels, but below I'm only including the first part of the dictionary
When I use variables, in the example below I get no errors.
from tkinter import *
root = Tk()
dic = {'response1':Label(root, bg='white')}
lbl = dic['response1']
lbl.config(text='Hey')
lbl.pack()
mainloop()
But when I do it without variables, like this
from tkinter import *
root = Tk()
dic = {'response1':Label(root, bg='white')}
dic['response1'].config(text='Hey').pack()
mainloop()
I get this error
AttributeError: 'NoneType' object has no attribute 'pack'
and since that, I need to declare a variable for each label in the dictionary so that I can avoid this error. So I'm asking how to declare a variable for each item in dictionary, where the key is the variable name. So response1 = Label(root, bg='white')
and so on for each item in the dictionary.