• 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:

  • 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….
  • AI monk holding a holy book facing a man in a suit, symbolizing ChatGPT’s perspective on God.
    Does ChatGPT believe in God? ChatGPT’s Personal OpinionSeptember 10, 2025
    Introduction Since the launch of ChatGPT, users have asked it all kinds of interesting, funny, and even thought-provoking questions. Recently, one user asked ChatGPT to share its personal opinion on the existence of God — without relying on references from religious texts like the Gita, Quran, or Bible. Instead, the request was for a purely…
  • Robot and human face-off in a dramatic breath-holding competition with cheering crowds
    ChatGPT vs Human: The Breath-Holding Chat That Ends in “System Failure”September 9, 2025
    People experiment with ChatGPT in countless ways every day. While many rely on ChatGPT and other AI tools for productivity and work, others turn to it purely for fun. Almost daily, new entertaining and funny conversations with ChatGPT surface online, and one such chat is currently going viral on social media. This particular exchange is…


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

  • Hospital Management System Project in C++
    Hospital Management System Project in C++
  • Amazon Summer Internship 2023
    Amazon Summer Internship 2023
  • Tank game in Python
    Tank game in Python
  • Get Jokes with Python
    Get Jokes with Python

Post navigation

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

Search

Recent Posts

  • 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
  • ChatGPT vs Human: The Breath-Holding Chat That Ends in “System Failure”
  • What Is Vibe Coding? The Future of No-Code Programming and Its Impact on Software Developers

Copyright © 2025 CopyAssignment