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