【发布时间】:2025-12-27 15:55:06
【问题描述】:
当我选择用户名和密码部分时,如何自动删除此提示? (点击后不显示)
from tkinter import *
root =Tk()
def save_fonc():
kul=entry1.get()
pas=entry2.get()
print("Username:",kul,"Password:",pas)
#------------------
entry1=Entry(root)
entry1.insert(0,"Username")
entry1.pack()
#------------------
entry2=Entry(root)
entry2.insert(0,"Password")
#entry2.config(show="*")#and also I don't want to show password section.
entry2.pack()
#------------------
buton_kaydet=Button(root,text="Enter",command=save_fonc)
buton_kaydet.pack()
root.geometry("300x200")
root.mainloop()
【问题讨论】:
-
您的代码中没有任何提示。
-
@Matiiss 他的意思是“用户名”在点击后仍然停留在输入框中。
-
@IsmailHafeez 这绝对不是他想要的,因为它无论如何都会在给定的代码中留在那里,哦,我明白了
-
@Matiiss 完全正确。他想删除它。
-
是的,如果可能的话,我想删除它。
标签: python tkinter passwords hide hint