Password Handling¶
tks.passwords provides 2 classes to obtain a password from a user
PasswordEntry- Displays a widget which allows the user to enter a password
PasswordDialog- Displays a dialog which allows the user to generate a random password.
-
class
tks.passwords.PasswordEntry(master, variable=None, show_hide=True, compare=True, generate=True, fonts=None, colors=None)¶ A password entry widget
Creates a frame which contains an entry box for a password and optionally
- A checkbox to show and hide the password
- A second entry box to make sure the password was entered as the user thought.
- A button which displays a dialog to generate a random password.
Parameters: - master (
ttk.Frame) – The master frame - variable (
StringVar) – The variable which hold the date to display in the entry boxes. - show_hide (bool) – If True a show/hide checkbox is added to show the actual characters.
- compare (bool) – If True a second entry box is shown to as a comparison.
- generate (bool) – If True a button is shown which displays a password generator when clicked.
- fonts (
DefaultFonts) – Fonts to use. - colors (
DefaultColors) – Fonts to use.