Horje
gui radio button python Code Example
gui radio button python
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import askyesno, askquestion




def selected():
    print(confirmed.get())


root = tk.Tk()

confirmed = tk.StringVar() #used to get the 'value' property of a tkinter.Radiobutton

# Note that I added a command to each radio button and a different 'value'
# When you press a radio button, its corresponding 'command' is called.
# In this case, I am linking both radio buttons to the same command: 'selected'

rconfirmed = tk.Radiobutton(text='Radio Button 1', variable=confirmed, 
                          value="yes", command=selected)
rconfirmed.pack()
rconfirmed= tk.Radiobutton(text='Radio Button 2', variable=confirmed, 
                          value="no", command=selected)
rconfirmed.pack()

root.mainloop()




Python

Related
odoo wizard current user login Code Example odoo wizard current user login Code Example
To convert Date dtypes from Object to ns,UTC. with Pandas Code Example To convert Date dtypes from Object to ns,UTC. with Pandas Code Example
pandas increment value on condition Code Example pandas increment value on condition Code Example
colab erase recycle bin drive Code Example colab erase recycle bin drive Code Example
kroki - hello.dot Code Example kroki - hello.dot Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10