radio button making
radio button making
tkinter を tkwin =Import as tk.Tk()win.title(‘윈도우’)win.geometry(‘300×250’)win.resizable(‘300×250’)win.resizable(False, False)def click (): checked = 1: data = ‘Blue’ elif checked == 2: data = ‘Red’elif checked == 3: data = ‘Green ‘elabel.configure(text= ‘선택: ‘ + data)check.IntVar() check1 = tk。ラジオボタン(win, text=’)青’, variable=checkVal, value=1, command=click)check1.grid(row=0, column=0, sticky=tk.W)W)check2 = tk。ラジオボタン(win, text=’)赤色’, variable=checkVal, value=2, command=click)check2.grid(row=0, column=1, sticky=tk.W)W)check3 = tk。ラジオボタン(win, text=’Green’, variable=checkVal, value=3, command=click)check3.grid(row=0, column=2, sticky=tk).W)W)label =tk. Label (win, Text=” (winterface) : : ‘)label.grid(row=1, column=0, columnspan=3, sticky=tk).W)W)win.mainloop ()
tkinter を tkwin = Import as tk.Tk()win.title(‘윈도우’)win.geometry(‘300×250’)win.resizable(‘300×250’)win.resizable(False, False)def click (): checked = 1: data = ‘Blue’ elif checked == 2: data = ‘Red’elif checked == 3: data = ‘Green ‘elabel.configure(text= ‘선택: ‘ + data)check.IntVar() check1 = tk。ラジオボタン(win, text=’)青’, variable=checkVal, value=1, command=click)check1.grid(row=0, column=0, sticky=tk.W)W)check2 = tk。ラジオボタン(win, text=’)赤色’, variable=checkVal, value=2, command=click)check2.grid(row=0, column=1, sticky=tk.W)W)check3 = tk。ラジオボタン(win, text=’Green’, variable=checkVal, value=3, command=click)check3.grid(row=0, column=2, sticky=tk).W)W)label = tk.Labels (win, text=’결과 : : ‘)label.grid(row=1, column=0, columnspan=3, sticky=tk).W)W)win.mainloop ()