Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

วิธีสร้าง Multiline Entry ใน Tkinter


ภาพรวม

สมมติต้องการสร้าง Entry Widget รองรับ Multiline User Input ใช้ Constructor Text()

ตัวอย่างโค้ด

# Import the library
from tkinter import *
# Create an object of tkinter window or frame
win = Tk()
# Define the geometry of window
win.geometry("650x250")
# Create an instance of Text Widget
text = Text(win)
text.pack()
win.mainloop()

ผลลัพธ์

รันโค้ดจะแสดงหน้าต่างที่มี Text Widget รองรับ Multiline User Input

วิธีสร้าง Multiline Entry ใน Tkinter