How to Validate an Entry Widget as an Integer - Python Tkinter GUI Tutorial #67

preview_player
Показать описание
In this video I'll show you how to determine whether someone typed an integer into an entry box or not.

There are many times when you need someone to only type a number into a text box. What happens if they type text instead? In this video I'll show you how to make sure they only type a number in to the box.

#tkinter #pythontkinter #tkintergui
Рекомендации по теме
Комментарии
Автор

Fantastic. Lovely clear uncluttered examples. Thank you

siobhanallen
Автор

I love your explanations. Since I started watching your videos I've never understood python more better with your explanations. Thanks a lot

maureenighogboja
Автор

That is the primary key - getting the user input before calling int() or float(). Salute to you, sir.

musaddikhossain
Автор

Beautiful videos, I made my first business program, for an company, thanks very much for tutorials, amazing!

lucaseduardoalves
Автор

Amazing Explanation...Just one query...How can we ensure that the ENTRY box can only take digits and decimal places ?

ranjanpal
Автор

Hi John, how to validate for the entry to accept float number in addition to integer values?

karthikrajamony
Автор

Thanks for showing us all this for free, most of the content you teach is difficult to get or understand elsewhere, will you make a video explaining how to change frames? or how to assign a textvariable to several entries created with a "for" loop, regards from Argentina.

maxibesso
Автор

When I use 'if e in list:' my program is always going to the else option
basically I am getting the user to input a number into the entry widget and the widget runs that number through the list and is supposed to say its its in the list but any number i put in, its saying its not in the list

ayanmadhu
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

How about decimal as well as a number restriction on the field..with no letters allowed.will float work for decimals too..??

ajsunofficial
Автор

Hi, i made an entrybox and want to check if it is a number ( float or integer - both should be possible)

try:
inputbox.get().replace(".", "", 1).isdigit()
print ("is a number")
except:
print ("is not a number !")

but it doesn't work :-(

-eckes-w.
Автор

Since you are the best tkinter tutor and I recommend you to anyone who ask me, I was wondering if you can cover a subject I couldn't find anyone covering even tho it's really handy.
Auto Complete Combo Box
When we assign values to a combo box how about when the user starts typing it just start auto completion based on letters in items in the list

AhmedHassan-joil
Автор

Hey John, I have a question. What you showed in the video just tells the user to enter an integer/float. How do I use the entry as a range or something in a for loop. Example: for i in range(my_box.get). When I type this, it shows the error that the range cannot be a string

anushjohn
Автор

Can you do a while loop for multiplication so when you multiple a number the loop keep going

danielwamboyo
Автор

How to add validation for entry label to enter only numbers
Like i have an entry name studentID_entry and have text variable=self.var_std_id


And the data is connected to database mysql


So how can i putt validation



To do this
When i enter data to save the data in database by cliking on the save button it shows enter only numbers

Hans_jagpalsukh
Автор

How do we make the number in the entry add to any number you want when you put it in

devchaudhari
Автор

how do i validate that the user has entered something? and if not, return an error message or a second try at inputting the data

Jammx
Автор

I'm trying to redo your code but I am always receiving this message error "'NoneType' object has no attribute 'get'" I don't understand.

Bruno_Felipe
Автор

Hi Brother Thank For Your Teaching I Find That Thing I Was Looking For :x

nimaojaghi
Автор

Can't we use "validate" attribute of Entry widget?

sidhumm