Simple sales tool creation using Python GUI: Employee number search (radio button)

Simple sales tool creation using Python GUI: Employee number search (radio button)

I changed what I posted before to the radio button method. This seems to be better if the number of employees is small. I'm using Spyder (python3.7).

#Search for employee number with radio button
import tkinter as tk

root = tk.Tk() 
root.geometry('300x150')
root.title('Employee')
radioValue = tk.IntVar() 
 #Enter the employee name in text and the employee number in value
rdioOne = tk.Radiobutton(root, text='Tanaka',
                             variable=radioValue, value=101)
rdioTwo = tk.Radiobutton(root, text='Suzuki',
                             variable=radioValue, value=202) 
rdioThree = tk.Radiobutton(root, text='Nomura',
                             variable=radioValue, value=303)
rdioOne.grid(column=0, row=0)
rdioTwo.grid(column=0, row=1)
rdioThree.grid(column=0, row=2)
#Employee number display method
labelValue = tk.Label(root, textvariable=radioValue)
labelValue.grid(column=2, row=0, sticky="E", padx=40)
root.mainloop()

Recommended Posts

Simple sales tool creation using Python GUI: Employee number search (radio button)
Simple sales tool creation with Python GUI: Employee number search
Simple sales tool creation with Python GUI: Quote creation
Simple sales tool creation with Python GUI: Cost rate calculation
Simple sales tool creation with Python GUI: Desktop application released
GUI creation in python using tkinter 2
GUI creation in python using tkinter part 1
Search Twitter using Python
# 1 [python3] Simple calculation using variables