from tkinter import *
win = Tk()
win.title("逻辑网")
win.geometry('500x200')
win.resizable(0, 0)
lb = Label(text='逻辑网', font=('微软雅黑', 18, 'bold'), fg='#CD7054')
lb.pack()
win.iconbitmap('../image/icon.ico')
CheckVar1 = IntVar()
CheckVar2 = IntVar()
CheckVar3 = IntVar()
check1 = Checkbutton(win, text="Python", font=('微软雅黑', 15, 'bold'), variable=CheckVar1, onvalue=1, offvalue=0)
check2 = Checkbutton(win, text="C语言", font=('微软雅黑', 15, 'bold'), variable=CheckVar2, onvalue=1, offvalue=0)
check3 = Checkbutton(win, text="Java", font=('微软雅黑', 15, 'bold'), variable=CheckVar3, onvalue=1, offvalue=0)
check1.pack(side=LEFT)
check2.pack(side=LEFT)
check3.pack(side=LEFT)
def study():
if CheckVar1.get() == 0 and CheckVar2.get() == 0 and CheckVar3.get() == 0:
s = '您还没选择任语言'
else:
s1 = "Python" if CheckVar1.get() == 1 else ""
s2 = "C语言" if CheckVar2.get() == 1 else ""
s3 = "Java" if CheckVar3.get() == 1 else ""
s = "您选择了%s %s %s" % (s1, s2, s3)
lb2.config(text=s)
btn = Button(win, text="选好了", bg='#BEBEBE', command=study)
btn.pack(side=LEFT)
lb2 = Label(win, text='', bg='#9BCD9B', font=('微软雅黑', 11, 'bold'), width=5, height=2)
lb2.pack(side=BOTTOM, fill=X)
win.mainloop()