raw_input

Gordon McMillan gmcm at hypernet.com
Sun Oct 31 07:54:37 EST 1999


Janos Blazi writes:

> When I start the following program from the IDLE under Windows
> NT, only the first raw_input is handled and the program never
> gets to the second raw_input.
> 
> But when I start it from the DOS prompt, everything works
> smothely.
> 
> Why is this so? Can somebody help me?
> 
> #============ program ===========
> t1=raw_input('line1: ')
> t2=raw_input('line2: ')
> print t1,t2
> #===============================

On Windows, GUI programs run under a different subsystem 
from console programs. The GUI subsystem has no concept 
of stdin, stdout or stderr. IDLE's interactive prompt is smart 
enough to fake them, but when running a script, it has no 
place to get input from. PythonWin pops up a little text entry 
dialog in this situation.

Look at it this way - if your user knows how to type, you don't 
need no stinkin' GUI <wink>.



- Gordon




More information about the Python-list mailing list