1

I have made a program in Python 3 and Tkinter, which is using radio buttons. Now, how can I make that some of the radio buttons are already checked?

1 Answer 1

1

You want to use the select method on the a radio button like so:

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()

For some more information about RadioButtons in tk check out this page on tutorials point:

http://www.tutorialspoint.com/python/tk_radiobutton.htm

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.