Python GUI - tkinter 이용한 Text & Entry widget 만들기
from tkinter import * root = Tk() root.title("GUI test") root.geometry("640X480") txt = Text(root, width=30, heigth=5) txt.pack() txt.insert(END, "군번, 성함, 부서를 입력하세요") #entry widget 사용 ent = Entry(root, width=30) ent.pack() ent.insert(0, "99.99.") #버튼 이용해 텍스트와 엔트리 값 가져오기 (get) 삭제는 ent.delete(0, END) def btncmd(): ent.get() btn = Button(root, text = "CLICK", command = btncmd) root.mainloop() 참고 : ..
2021. 8. 26.