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

  • AI running fully offline on a smartphone using Google AI Edge Gallery with on-device multimodal analysis and no internet connection
    You Can Now Run AI Fully Offline on Your Phone — Google’s Gemma 4 Just Changed EverythingApril 7, 2026
    What if your smartphone could run a powerful AI assistant without internet, without cloud, and without API costs? That’s now possible. Google recently introduced a new generation of compact AI models designed specifically for on-device use, and they can run entirely offline on consumer phones using the AI Edge Gallery app. This marks a major…
  • A laptop showing Python code automating article generation and publishing to a website with APIs and content pipeline visuals
    I Built a 24×7 AI Blogging System for WordPress Using Python (Free) — Full Code InsideApril 5, 2026
    In this article, I will show you how I built a powerful Python-based system that automatically generates and publishes articles to WordPress — completely free and running 24×7. This project handles everything: All you need to do is provide keywords. What This System Actually Does This is not just a script—it’s a complete automation pipeline….
  • A person using a laptop with an AI chatbot interface, surrounded by notes, coffee, and money on a desk, representing creative prompting and high-value AI results
    This Reddit User “Hacked” AI With Simple Tricks… And The Results Are InsaneApril 4, 2026
    What if you could get dramatically better answers from AI—without any advanced prompting skills, tools, or coding? A recent Reddit post is going viral for exactly this reason. The user claims they’ve been “manipulating” AI models using simple psychological tricks—and surprisingly, the results are much better. Now, this isn’t some technical exploit or hidden feature….
  • A computer terminal showing a dangerous rm -rf command deleting files, with servers in the background and money flying to represent massive financial loss
    One “rm -rf” Command Almost Wiped Out $100 Million Worth of Toy Story 2April 4, 2026
    In software, a single command can make or break everything. But in the late 1990s, one mistake at Pixar nearly erased months of work—and potentially $100 million worth of production—on Toy Story 2. This isn’t a myth. It’s a real incident that developers still talk about today. What Actually Happened During production, the team was…
  • laptop with AI interface surrounded by money, stock charts, and creative tools representing earning with ChatGPT in 2026
    How to Make Money with ChatGPT in 2026: A Real Guide That Still WorksApril 3, 2026
    There’s a silent thought many people are carrying right now. It doesn’t always get said out loud, but it’s there: “AI has made everything too competitive… maybe it’s too late now.” It feels like everyone is doing something online. Everyone has access to tools like ChatGPT. Content is everywhere. Freelancers are everywhere. Ideas are everywhere….


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

  • Rock Paper Scissors Game in Python
    Rock Paper Scissors Game in Python
  • Auto Login with Python
    Auto Login with Python
  • Sales Management System Project in Python
    Sales Management System Project in Python
  • Chess Board using Python

Post navigation

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

Search

Recent Posts

  • You Can Now Run AI Fully Offline on Your Phone — Google’s Gemma 4 Just Changed Everything
  • I Built a 24×7 AI Blogging System for WordPress Using Python (Free) — Full Code Inside
  • This Reddit User “Hacked” AI With Simple Tricks… And The Results Are Insane
  • One “rm -rf” Command Almost Wiped Out $100 Million Worth of Toy Story 2
  • How to Make Money with ChatGPT in 2026: A Real Guide That Still Works
  • PicoClaw vs OpenClaw: The Tiny AI That Could Replace Powerful AI Agents

Copyright © 2026 CopyAssignment