[Tutor] On a looping input, subsequent inputs are hidden
Steven D'Aprano
steve at pearwood.info
Tue Jun 11 14:59:21 CEST 2013
On 11/06/13 16:17, Jim Mooney wrote:
> This is puzzling me. I'm inputing an integer, giving a different
> visual and audio alert depending if it's bad or good, and that works
> fine. I'm looping input to ask for input again if a noninteger is
> entered. That works.
>
> But the Second and subsequent inputs, in Windows, hide the input with
> dots, while the first shows the input, and I can't figure out why.
I'm afraid I don't understand what you mean. Second and subsequent inputs? I only see one. Hide the input with dots?
Can you copy and paste an example?
Further comments below.
> I
> don't change a thing between the first and subsequent calls to input
> except changing the input message to an error message. But it's just
> python input, not tkinter. Unless it's a Windows peculiarity. The
> input Always shows in DOS. But if it doesn't show in Linux, let's say,
> then I would guess it's a Python thing, and maybe there's a switch to
> turn that effect off.
For what it's worth, I cannot replicate this error. When I try your code on Linux, with a few minor adjustments to make it work (e.g. commenting out the winsound parts) it works fine for me.
> ============ main program ======================
[snip code]
> except (KeyboardInterrupt, EOFError): #1st Except for GUI, 2nd for
> Cmd window
> pop.popup('You cancelled, you so bad!') #string must contain
> 'bad' to trigger audio
> exit(0)
What's exit()? Is that sys.exit?
--
Steven
More information about the Tutor
mailing list