0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PythonGUIによる簡易営業ツール作成:社員番号検索(ラジオボタン)

Posted at

#PythonGUIによる簡易営業ツール作成:社員番号検索(ラジオボタン)
以前投稿したものをラジオボタン方式にして変更しました。社員数が少ない場合はこちらの方が良さそう。Spyder(python3.7)を使ってます。

#ラジオボタンで社員番号検索
import tkinter as tk

root = tk.Tk() 
root.geometry('300x150')
root.title('社員')
radioValue = tk.IntVar() 
 #textには社員名、valueには社員番号入力
rdioOne = tk.Radiobutton(root, text='田中',
                             variable=radioValue, value=101)
rdioTwo = tk.Radiobutton(root, text='鈴木',
                             variable=radioValue, value=202) 
rdioThree = tk.Radiobutton(root, text='野村',
                             variable=radioValue, value=303)
rdioOne.grid(column=0, row=0)
rdioTwo.grid(column=0, row=1)
rdioThree.grid(column=0, row=2)
#社員番号表示方法
labelValue = tk.Label(root, textvariable=radioValue)
labelValue.grid(column=2, row=0, sticky="E", padx=40)
root.mainloop()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?