Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python.
What is a placeholder and how can it be implemented using tkinter:
In programming, a placeholder may be a character, word, or string of characters that briefly takes the place of the final data. For instance, an applied scientist might recognize that she desires a precise range of values or variables, however does not however recognize what to input.
The Placeholder attribute is used to give hint that tells what input is expected by input field, or we can say it will give the short hint that is displayed within the input field before the user enters a value.
In Tkinter there is no in-built method or property for placeholder but it can still be executed using the modules’ inbuilt functions.
- Import module
- Create Normal Tkinter Window
- Add Entry box
Entry(Object Name, **attr)
- Add placeholder, here it is done using insert() and then the same is bonded to the box
- Execute code
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.