[Idle-dev] IDLE getpass?
Douglas S. Blank
dblank at brynmawr.edu
Thu Jul 26 19:59:52 CEST 2007
Tal Einat wrote:
> On 7/26/07, Douglas S. Blank <dblank at brynmawr.edu> wrote:
>> Is there an easy way that one can enter a password in IDLE but not have
>> the characters show (or just show asterisks)? The only way I can think of
>> is to bind(<KeyPress>) but that seems to be overkill. I'm looking for
>> something like replacing sys.stdout or some Tkinter function. Any hints
> A good starting point would be:
> from tkSimpleDialog import askstring
> askstring('Enter Password', 'Password: ', show='*')
> You'd have to work out a few Tk kinks to get it to work smoothly...
> but it works.
Thanks for the pointer. This brings up some additional questions:
1) It looks like that the trick here is to set
entry.configure(show='*'). Can that be done in the Python Shell in IDLE?
That is, can one temporarily make all characters that you type in the
Python Shell be *?
2) How does one get a hold of the PyShell once IDLE has already started?
(If this is possible, I'd like to know for other reasons besides this one).
3) If I have to open a Tk window, how can I get it to appear on top of
the IDLE window?
Thanks for any additional hints,
> - Tal
More information about the IDLE-dev