Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13921

.get() func for button widget in tkinter

$
0
0

I want to get information from the button to pass an if conditional inside of a window. I am planning to add +10 widgets that have functions bound to them after that condition. I would appreciate it if you could answer.

from tkinter import *condition = Nonewindow = Tk()button = Button(window,text="button",command= lambda: condition == True)button.pack()if condition:    label = Label(window,text="hello this is a label")    label.pack()window.mainloop()

I tried this but it couldn't pass the if conditional.


Viewing all articles
Browse latest Browse all 13921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>