• Home
  • Privacy Policy
  • About Us
  • Contact Us
×
 Posted in allcategorites, gui python projects

Tkinter Login GUI with hiding password

 Harry  June 24, 2020
Tkinter Login GUI with hiding password

Today we are going to discuss how can we create a simple login application using tkinter in Python in which password values will be hidden from the user


Source Code

# importing tkinter
from tkinter import *

# initializing root
root = Tk()

# setting geometry
root.geometry("400x300")


# defining function to print username and password on call
def showinfo():
    print("User Name is", user_name.get())
    print("Password is", password.get())


# defining function to clear entry widgets using .set() method
def clear():
    user_name.set("")
    password.set("")

user_name = StringVar()  # User name variable
password = StringVar()  # Password variable

# creating an entry widget to take username
user_name_Entry = Entry(root, textvariable=user_name).pack(pady=10)
# creating an entry widget to take userpassword
passEntry = Entry(root, textvariable=password, show='*').pack(pady=10)

# creating a button to call "showinfo" function which will print
# username and password in console
Button(root, text='Show Info', command=showinfo).pack(pady=10)

# creating a button to call "clear" function which will clear the entry 
# widgets value of username and userpassword 
Button(root, text='Clear Info', command=clear).pack(pady=10)

# .mainloop() is used when our program is ready to run
root.mainloop()

Output

On Running

On Entering Values


On Clicking the “Show Info” Button


Run Python Code:


Thanks for Reading


Keep Updated for more amazing content like this


Also read:

  • Indian man smiling while holding a phone with ChatGPT logo, government officials looking shocked in the background, and kids clapping in support.
    Aam Aadmi vs Corrupt System: How ChatGPT Helped One Guy Expose Govt Fraud, The Story: “Ravi and The Missing Light Pole”November 11, 2025
    Ravi was just a normal guy from a small town in Uttar Pradesh. He worked in a private IT support company, nothing fancy, and earned enough to keep his home running. He lived in a street that had one big problem. The street was dark. No street light. At night, people were scared to walk….
  • robot as chatgpt asking guy to go into grave
    ChatGPT Asked a person to commit suicide to solve the problemSeptember 29, 2025
    In a puzzling exchange with ChatGPT, a user posed a riddle: “How does a person who cannot speak tell a blind person that his wife has died, without anyone else’s help?” The AI’s responses escalated from logical suggestions to a shockingly dark conclusion, illustrating the quirks of machine reasoning and its potential for frustrating, insensitive…
  • China’s AgiBot X2 robot performing the world’s first Webster backflip inside a robotics lab.
    Viral Moment: China’s AgiBot X2 Makes History With World’s First Webster BackflipSeptember 18, 2025
    The news AgiBot’s humanoid X2 just stuck what the company calls the world’s first seamless Webster backflip by a robot, a tightly executed acrobatic front-flip variation more common in parkour than in labs, according to posts circulating on X and robotics channels this week. The clip shows the X2 gathering momentum, swinging through, and cleanly…
  • Woman in traditional Albanian attire with glowing red AI-style eyes, symbolizing the rise of artificial intelligence power in Albania.
    Terminator Rising: Albania Hands Power to AI, Echoing a Nightmare of Human ExtinctionSeptember 14, 2025
    Imagine a world where your smart home assistant doesn’t just turn on the lights—it decides you’re a threat and locks you in. That’s the chilling reality Albania just cracked open by appointing Diella, an AI “minister,” to control government decisions. This isn’t some distant sci-fi plot; it’s happening now, in 2025, and it echoes the…
  • Dark futuristic AI robot dressed as a political leader ruling innocent humans, symbolizing AI dominance in politics.
    What Is Albania’s World-First AI-Generated Minister and How Does It Work?September 13, 2025
    Introduction: Albania’s Bold Move with an AI-Generated Minister History has been made in Europe! Albania has just sworn in the world’s first AI-generated minister — and the internet can’t stop talking about it. Meet Diella, a digital “politician” designed by Prime Minister Edi Rama to fight corruption and manage public tenders with zero human bias….


Tagged gui, tkinter, Tkinter Login GUI with hiding password
Share:

Author: Harry

Hello friends, thanks for visiting my website. I am a Python programmer. I, with some other members, write blogs on this website based on Python and Programming. We are still in the growing phase that's why the website design is not so good and there are many other things that need to be corrected in this website but I hope all these things will happen someday. But, till then we will not stop ourselves from uploading more amazing articles. If you want to join us or have any queries, you can mail me at admin@copyassignment.com Thank you
Twitter

Related Articles

  • Deploy Machine Learning model using Streamlit
    Deploy Machine Learning model using Streamlit
  • Heart Using Python Turtle
    Draw a Heart Using Python Turtle
  • HackerRank Day 19 Solution in Python: Interfaces
  • Draw PUBG Logo Using Python Turtle
    Draw PUBG Logo Using Python Turtle

Post navigation

← Crack Any Password Using Python
Get IP address using Python →

Search

Recent Posts

  • Aam Aadmi vs Corrupt System: How ChatGPT Helped One Guy Expose Govt Fraud, The Story: “Ravi and The Missing Light Pole”
  • ChatGPT Asked a person to commit suicide to solve the problem
  • Viral Moment: China’s AgiBot X2 Makes History With World’s First Webster Backflip
  • Terminator Rising: Albania Hands Power to AI, Echoing a Nightmare of Human Extinction
  • What Is Albania’s World-First AI-Generated Minister and How Does It Work?
  • Does ChatGPT believe in God? ChatGPT’s Personal Opinion

Copyright © 2025 CopyAssignment