1
我在Python 3和Tkinter中使用單選按鈕創建了一個程序。現在,我怎樣才能使一些單選按鈕已經被檢查?python 3和tkinter中的單選按鈕
我在Python 3和Tkinter中使用單選按鈕創建了一個程序。現在,我怎樣才能使一些單選按鈕已經被檢查?python 3和tkinter中的單選按鈕
您要使用的選擇方法上的一個單選按鈕,如下所示:
import tkinter as tk
root = tk.Tk()
root.title("Radio Button Example")
button = tk.Radiobutton(root) # Make a radio button
button.pack() # Pack it to the screen
button.select() #This is the bit that makes it checked
root.mainloop()
有關單選按鈕的一些詳細信息,在TK查看此頁面上的教程指出:
好的,非常感謝你! :) – joza