+ 1

in python how i accept password from user in * formate and if i press button i see the original password in that entry field.

20th Aug 2018, 12:26 AM
aditya
aditya - avatar
2 Respuestas
+ 1
from tkinter import * from functools import partial def validateLogin(username, password): print("username entered :", username.get()) print("password entered :", password.get()) return #window tkWindow = Tk() tkWindow.geometry('400x150') tkWindow.title('Tkinter Login Form - pythonexamples.org') #username label and text entry box usernameLabel = Label(tkWindow, text="User Name").grid(row=0, column=0) username = StringVar() usernameEntry = Entry(tkWindow, textvariable=username).grid(row=0, column=1) #password label and password entry box passwordLabel = Label(tkWindow,text="Password").grid(row=1, column=0) password = StringVar() passwordEntry = Entry(tkWindow, textvariable=password, show='*').grid(row=1, column=1) validateLogin = partial(validateLogin, username, password) #login button loginButton = Button(tkWindow, text="Login", command=validateLogin).grid(row=4, column=0) tkWindow.mainloop() code source: https://pythonexamples.org/JUMP_LINK__&&__python__&&__JUMP_LINK-tkinter-login-form/ happy coding!
6th Aug 2020, 9:30 AM
sujay simha
sujay simha - avatar
0
Oh thanks sujay
14th Aug 2020, 5:49 PM
aditya
aditya - avatar