tkinter clear entry
widget.delete(0, END)
python tkinter clear entry
# Clear an entry widget on button press
from tkinter import *
root = Tk()
def clearEntryInput():
entry.delete(0, END)
entry = Entry(root, width=30) # You must .pack() or .grid() on the next line
entry.pack()
Button(root, text="Clear", command=clearEntryInput).pack()
root.mainloop()
# This is the error you get if you .pack() or .grid() on the same line:
# AttributeError: 'NoneType' object has no attribute 'delete'
# https://stackoverflow.com/questions/13002843/attributeerror-nonetype-object-has-no-attribute-delete
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us