import tkinter as tk
def select():
dict1 = {
1: 'JAVA', 2: 'C++', 3: 'python', 4: 'C'}
strings = '您选择了' + dict1.get(v.get()) + ',祝您学习愉快'
lable.config(text=strings)
window = tk.Tk()
window.title("逻辑网")
window.geometry('400x180')
window.iconbitmap('../image/icon.ico')
lable = tk.Label(window, font=('微软雅黑', '15', 'bold'), fg='#43CD80')
lable.pack(side='bottom')
site = [('JAVA', 1),
('C++', 2),
('python', 3),
('C', 4)]
v = tk.IntVar()
for name, num in site:
radio_button = tk.Radiobutton(window, text=name, variable=v, value=num, command=select, indicatoron=True)
radio_button.pack(anchor='w')
window.mainloop()