How to clear the Entry widget after a button is pressed in Tkinter?

后端 未结 11 1115
渐次进展
渐次进展 2020-12-01 10:44

I\'m trying to clear the Entry widget after the user presses a button using Tkinter.

I tried using ent.delete(0, END), but I got an error

11条回答
  •  余生分开走
    2020-12-01 11:03

    If in case you are using Python 3.x, you have to use

    txt_entry = Entry(root)

    txt_entry.pack()

    txt_entry.delete(0, tkinter.END)

提交回复
热议问题