[英]Tkinter - How to have a different text display in a Text widget to what is being edited
[英]How to check if text widget is edited in tkinter python?
我想了解如何檢查 tkinter python 中的文本小部件是否被編輯。 誰能幫幫我嗎? 提前致謝!
import tkinter as tk
def text_edited(e):
print('Current text:',t.get(1.0,tk.END))
print(e.keysym, ' was pressed')
root=tk.Tk()
t=tk.Text(root)
t.pack()
t.bind('<Key>',text_edited)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.