from Tkinter import *
class Gui:
def __init__(self):
self.root = Tk()
self.var = IntVar()
self.label = Label(self.root)
self.label.pack()
R1 = Radiobutton(self.root, text="Option 1", variable=self.var, value=1,
command=self.sel())
R1.pack( anchor = W )
R2 = Radiobutton(self.root, text="Option 2", variable=self.var, value=2,
command=self.sel())
R2.pack( anchor = W )
R3 = Radiobutton(self.root, text="Option 3", variable=self.var, value=3,
command=self.sel())
R3.pack( anchor = W)
self.root.mainloop()
def sel(self):
print 'haha...'
selection = "You selected the option " + str(self.var.get())
self.label.config(text =selection)
myapp=Gui()