Created
December 8, 2014 06:14
-
-
Save anonymous/e6b0a0c6b864ca5551fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
def sel(): | |
selection = "You selected the option " + str(var.get()) | |
label.config(text=selection) | |
root = Tk() | |
var = IntVar() | |
R1 = Radiobutton(root, text="Option 1", variable=var, value=1, command=sel) | |
R1.pack(anchor=W) | |
R2 = Radiobutton(root, text="Option 2", variable=var, value=2, command=sel) | |
R2.pack(anchor=W) | |
R3 = Radiobutton(root, text="Option 3", variable=var, value=int(var), command=sel) | |
R3.pack(anchor=W) | |
label = Label(root) | |
label.pack() | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment