O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validating user input

Let's discuss input data validation in Tkinter.

Most of the applications that we have developed in our book are point-and-click-based (the drum machine, the chess game, and the drawing application), where a validation of user input is not required. However, data validation is a must in programs such as the phone book application, where a user enters some data and we store it in a database.

Ignoring user input validation can be dangerous in such applications because input data can be misused for SQL injection. In general, an application in which a user can enter textual data is a good candidate for the validation of user input. In fact, not trusting user inputs is almost considered a maxim.

Wrong user inputs may be intentional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required