import tkinter as tk
win=tk.Tk()
win.title('RadioButton')
win.geometry('300x400')
def select2():
value=var2.get()
var.set("您的选择为%s"%value)
var=tk.StringVar()
label=tk.Label(win,bg='yellow',textvariable=var,width=18,height=2)
label.pack()
var2=tk.StringVar()
rb=tk.Radiobutton(win,text='OptionA',value='A',variable=var2,command=select2)
rb.pack()
rb2=tk.Radiobutton(win,text='OptionB',value='B',variable=var2,command=select2)
rb2.pack()
win.mainloop()