Search code examples
pythontkinterpasswordstkinter-entry

Python Tkinter Password Box - How to make it similar to a bash password prompt where the length is hidden?


I've made a tkinter password Entry such as:

passwordEntry = Entry(app, show="*")

I'd like to do away with the asterisks and make it completely anonymous so others next to you can't even see the length of your password.


Solution

  • If you set the foreground and background to the same color, all they will see is spaces, and I bet it would be almost impossible for them to count the spaces.

    Or, just don't use an entry widget. Use some other widget (Label, Frame, Canvas) and some bindings on <Key> to keep track of what they typed.