如何在Tkin中隐藏密码

2024-09-30 16:29:39 发布

您现在位置:Python中文网/ 问答频道 /正文

def lock():
    global pas,lk
    lk=Tk.Frame(main)
    lk.pack(fill="both", anchor="center", expand=1)
    Tk.Label(lk, text="", font="arial 75").pack(anchor="center", side="top")
    fpas=Tk.LabelFrame(lk, text="Zadejte heslo:")
    fpas.pack(anchor="center")
    pas=Tk.Entry(fpas)
    pas.pack()
    Tk.Button(lk, text="OK", command=check).pack(side="top")
    Tk.Button(lk, text="Vypnout", command=lkend).pack(side="top")
    return

这是我代码的一部分,我想更改它。当我将密码写入名为Tk.Entrypas时,我不想看到数字,而只想看到一个特定的符号,比如*或其他符号。谢谢你的回答。在

注:请不要评估我的代码,我知道我可以写得更好,但我只要求如何隐藏密码,而不是我的技巧:-D


Tags: 代码text密码topbuttonpassidecommand