Lecture 기본위젯 - entry

Views 85 • Comments 0 • Last Updated at 6 months ago Full screen  
  • 윈도우 프로그램
  • 윈도우 프로그램

entry

entry는 텍스트를 입력할 수 있는 위젯이다. 일반적으로 레이블과 같이 사용된다.

from tkinter import *
 
top = Tk()
L1 = Label(top, text="Label")
L1.pack(side=LEFT)
E1 = Entry(top, bd=5)
E1.pack(side=RIGHT)
 
top.mainloop()

entry를 패스워드를 입력받는 시스템을 만들수 있다.

import tkinter as tk
 
window = tk.Tk()
window.title('Input password')
window.geometry('300x200') 
lbl1 = tk.Label(window, text='Username')
lbl1.grid(row = 0, column=0) 
e1 = tk.Entry(window, show=None, font=('Arial', 14))  
e1.grid(row = 0, column=1)
lbl2 = tk.Label(window, text='Password')
lbl2.grid(row = 1, column=0)
e2 = tk.Entry(window, show='*', font=('Arial', 14))   
e2.grid(row = 1, column=1)
 
window.mainloop()
previous article
next article
Comments
Feel free to ask a question, answer or comment, etc.