결과
코드
복사코드
from tkinter import *
window=Tk()
select = IntVar()
select.set(1)
list=[("Python",1), ("C",2), ("Java",3), ("C#",4), ("C++",5)]
def printchoice():
print(select.get())
Label(window, text="프로그래밍 언어 선택",justify=LEFT, padx=20).pack()
for txt, val in list:
Radiobutton(window,text=txt,padx=20,variable=select,command=printchoice,value=val).pack(anchor=W)
'Python > python 개발' 카테고리의 다른 글
[파이썬/python] 타이머 tk (0) | 2022.01.20 |
---|---|
[파이썬/python] 체크버튼(from tkinter import *)tk (0) | 2022.01.19 |
[파이썬/python] 계산기(from tkinter import *)tk (0) | 2022.01.17 |
[파이썬/python] 개인정보 제출 코드(from tkinter import *)tk (0) | 2022.01.15 |
파이썬 연락처(추가, 삭제, 수정) 코드 (0) | 2021.12.30 |