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

  • Artificial Intelligence Showdown: Weighing OpenAI Against Mistral CapabilitiesMarch 9, 2026
    Overview As a developer using Python, choosing the right model for your project can be a daunting task. Two popular models that have gained significant attention in recent years are OpenAI GPT and Mistral. In this article, we will compare and contrast these two models, highlighting their strengths, weaknesses, and use cases to help you…
  • Codex Security enters experimental phase for testing and evaluation purposesMarch 9, 2026
    Codex, the AI model developed by Microsoft, has made significant strides in recent times. The latest development in this space is the introduction of Codex Security, which is now available in research preview. This announcement has the potential to greatly impact the way developers approach AI-powered applications, particularly in terms of security and reliability. What…
  • How Balyasny Asset Management built an AI research engine for investingMarch 9, 2026
    Balyasny Asset Management has developed an AI research engine for investing, marking a significant advancement in the use of artificial intelligence in finance. This engine is designed to improve investment decisions by analyzing vast amounts of data and identifying patterns that may not be apparent to human researchers. For more information, visit the source to…
  • Why AI models like GPT, Claude, and Gemini are becoming similar due to the transformer architecture and scaling of large language models
    Why All AI Models Are Slowly Becoming the Same ModelMarch 7, 2026
    Artificial Intelligence has progressed at an astonishing speed over the last few years. In a short period of time, the world moved from simple chatbots and rule-based systems to powerful language models capable of writing code, solving complex problems, and assisting in research. At first glance, it appears that many different companies are building very…
  • 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….


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

  • Python | Return multiple values from a function
  • Hotel Management System Project Using Python with source code
    Hotel Management System Project Using Python with source code
  • Python function that takes a list and returns a new list with unique elements of the first list
  • Whatsapp Spam Bot Using Python Selenium
    Whatsapp Spam Bot Using Python Selenium

Post navigation

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

Search

Recent Posts

  • Artificial Intelligence Showdown: Weighing OpenAI Against Mistral Capabilities
  • Codex Security enters experimental phase for testing and evaluation purposes
  • How Balyasny Asset Management built an AI research engine for investing
  • Why All AI Models Are Slowly Becoming the Same Model
  • 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

Copyright © 2026 CopyAssignment