You can get the content of the entry using Tkinter.Entry.get
method.
Check the length of the entry using len
function and get
method:
if len(entry_object.get()) == 0: # empty!
# do something
or more preferably:
if not entry_object.get(): # empty! (empty string is false value)
# do something
Use for
loop to check several entry widgets:
for entry in entry_list:
if not entry_object.get():
# empty!
You should populate entry_list
beforehand.
Manually:
entry_list = []
entry = Entry(...)
...
entry_list.append(entry)
entry = Entry(...)
...
entry_list.append(entry)
or, using winfo_children
method (to get all entries):
entry_list = [child for child in root_widget.winfo_children()
if isinstance(child, Entry)]