Prints in the console for me. If you want it to print in a label then you will have to let it know to.
from tkinter import * root = Tk() def ans1(): AnswerSelected = 44 label['text'] = AnswerSelected print (AnswerSelected) label = Label(root) label.grid(column=5, row=4) Answer1 =Button(root,text="Click me", padx=50, pady=50, bg ="red", command =ans1) Answer1.grid( row =5, column = 5) root.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags