we have always seen that password is always hidden to user himself, for data security. This section will help you to collect the data entered by user but displaying it as hidden.
in option , value assigned to show option will be displayed in entry widget, any value can be set here
show='*'
below is the code for above screen shot GUI.
#program
try:
from Tkinter import *
except:
from tkinter import *
def collect_data():
print('data entered : ', le.get())
mw = Tk()
mw.geometry("500x100+50+50")
mw.title("AETies : Automation Expert Technologies")
mw.config(background='#eeeeee')
l1 = Label(mw, text=' Password : ', bg='#eeeeee')
l1.pack(side=LEFT)
le = Entry(mw, width=20, show='*')
le.pack(side=LEFT)
bt = Button(mw, text=' collect ', fg='red', command=collect_data)
bt.pack(side=LEFT)
mainloop()
#output
data entered : aeties
Comments
Post a Comment