Tkinter display and mask password in an entry box based on Checkbutton click event using show option
We can control to show or hide chars in an Entry widget using click event of a Checkbutton.
Function my_show()
This function based on the Checkbutton status will show or hide the chars of Entry box. Here c_v1 is one IntVar. It will hold the value 1 ( onvalue ) if Checkbutton is checked, otherwise 0
def my_show():
if(c_v1.get()==1):
e1.config(show='') # display the chars
else:
e1.config(show='*')# hide the chars using mask