my function wont carry out for the button assigned. Im using visual studio code. For the
def myClick():
myLabel =Label(window, text …, command…
it wont occur. on visual studio code, the ‘myLabel’ greys out and has the error ‘is not accessedPylance’
# add response to input
def myClick():
myLabel = Label(window, text="Hello" + e.get() + "... ")
myLabel.pack
# create button
myButton = Button(window, text="next", command=myClick, fg="black")
myButton.pack()
>Solution :
I think its just that you are not calling pack(). When I fix that I see the label appear:
def myClick():
myLabel = Label(window, text="Hello" + e.get() + "... ")
myLabel.pack()