top of page

How to hide your Password at the time typing in Python Scripts inside Tkinter?

Subham Das

Here I have explained how we can hide our password inside the Entry widget in Tkinter library. We need to call one parameter name "show" inside the Entry widget which will help us a lot.


# Importing the module name Tkinter

from tkinter import * win = Tk()

# This Entry widget will accept the password from user. pas = Entry(win, show = "*") pas.place(x = 70,y = 0)


lab = Label(win, text = "Password :") lab.place(x = 0, y = 0) def mark() : if var.get() == 1 : pas.configure(show = "") elif var.get() == 0 : pas.configure(show = "*") var = IntVar()


# I have used check button for my convenience.

# This will help us to to enable or disable the hiding the password. bt = Checkbutton(win, command = mark, offvalue = 0, onvalue = 1, variable = var) bt.place(x = 170, y = 0) win.mainloop()




2,606 views0 comments

Recent Posts

See All

Comments


logo12.PNG

Join my mailing list

2019 established by trueprogrammer

bottom of page