Để ô Entry hiển thị mật khẩu dưới dạng dấu sao (*), thiết lập thuộc tính show="*".
Ví dụ minh họa
from tkinter import *
from tkinter import ttk
win = Tk()
win.geometry("700x350")
def show():
p = password.get()
ttk.Label(win, text="Mật khẩu của bạn: " + str(p)).pack()
password = StringVar()
Entry(win, width=25, textvariable=password, show="*").pack(pady=10)
ttk.Button(win, text="Hiện mật khẩu", command=show).pack()
win.mainloop()
Kết quả đầu ra
Ô nhập mật khẩu hiển thị *, nút Hiện mật khẩu in ra mật khẩu thật.

Nhấn nút hiện mật khẩu.
