0
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

This is a part of my code and I want to change it. When I write my password into Tk.Entry called pas, I don´t want to see numbers, but a only specific symbol, such as * or another symbol. Thanks for the answer.

P.S: Please don´t evaluate my code, I know that I can write it better, but I only ask for how to hide a password, not for my tkinter skills :-D

j_4321
  • 15,431
  • 3
  • 34
  • 61
John
  • 43
  • 1
  • 7

1 Answers1

6

Just use the show option of the Entry widget:

pas = Tk.Entry(fpas, show='*')
j_4321
  • 15,431
  • 3
  • 34
  • 61