วิดเจ็ต Tkinter Entry เป็นวิดเจ็ตอินพุตที่รองรับและยอมรับอินพุตของผู้ใช้บรรทัดเดียว ยอมรับอักขระทุกประเภทในโมดูล UTF-8 ในการรับอินพุตจากวิดเจ็ตรายการ เราต้องกำหนดตัวแปร (ตามประเภทข้อมูลที่ยอมรับ) ที่ยอมรับเฉพาะอักขระสตริงเท่านั้น จากนั้นโดยใช้เมธอด get() เราสามารถพิมพ์อินพุตที่กำหนดจากวิดเจ็ตรายการได้
ตัวอย่าง
# Import the Tkinter Library
from tkinter import *
# Create an instance of Tkinter Frame
win = Tk()
# Set the geometry of window
win.geometry("700x250")
# Define a String Variable
var = StringVar()
# Define a function to print the Entry widget Input
def printinput(*args):
print(var.get())
# Create an Entry widget
entry = Entry(win, width=35, textvariable=var)
entry.pack()
# Trace the Input from Entry widget
var.trace("w", printinput)
win.mainloop() ผลลัพธ์
การเรียกใช้โค้ดด้านบนจะแสดงหน้าต่างพร้อมวิดเจ็ตรายการ

เมื่อเราเขียนบางอย่างในวิดเจ็ตรายการ มันจะพิมพ์อักขระทั้งหมดจากวิดเจ็ตรายการบนคอนโซล
H He Hel Hell Hello Hello Hello W Hello Wo Hello Wor Hello Worl Hello World Hello World!