- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a password entry field using Tkinter?
Let us suppose we want to add an Entry widget which accepts user passwords. Generally, the passwords are displayed using “*” which yields to make the user credentials in an encrypted form.
We can create a password field using tkinter Entry widget.
Example
In this example, we have created an application window that will accept the user password and a button to close the window.
#Import the required libraries from tkinter import * #Create an instance of tkinter frame win= Tk() #Set the geometry of frame win.geometry("600x250") def close_win(): win.destroy() #Create a text label Label(win,text="Enter the Password", font=('Helvetica',20)).pack(pady=20) #Create Entry Widget for password password= Entry(win,show="*",width=20) password.pack() #Create a button to close the window Button(win, text="Quit", font=('Helvetica bold', 10),command=close_win).pack(pady=20) win.mainloop()
Output
Running the above code will display a window with an entry field that accepts passwords and a button to close the window.
Now, enter the password and click the “Quit” button to close the window.
- Related Articles
- How to create a Password Entry Field in Tkinter?
- How to create a password field using JavaFX?
- How to create a multiline entry with Tkinter?
- Creating a popup message box with an Entry field in tkinter
- How to create a timer using tkinter?
- How to create a Splash Screen using Tkinter?
- How to create a simple screen using Tkinter?
- How to connect a variable to the Tkinter Entry widget?
- How to get the value of a button in the Entry widget using Tkinter?
- How to verify the password entered in the JavaFX password field?
- How to create a text field using JavaFX?
- How to set default text for a Tkinter Entry widget?
- How to use the Entry widget in Tkinter?
- How to disable an Entry widget in Tkinter?
- How to create a password generator - JavaScript?

Advertisements