[wingide-users] Using stdin/stdout when debugging

Wingware Support support at wingware.com
Fri Jan 29 10:29:28 MST 2010


Denis Kirienko wrote:
> Hello!
>
> I am going to use WingIDE 101 + Python 3 for teaching programming at
> high school.
>
> The children will write a simple programs with standart input-output like this:
>
> data=input().split()
> print(int(data[0])+int(data[1]))
>
> When we run this program without debugging, all looks OK, we enter
> line "1 2" in the "Python shell" window and get the correct result.
>
> But when we try to debug such application, we have a problem. Lets
> start the apllication and enter the next data to the "Debug I/O
> window":
>
> 1 1
> 2 2
> 3 3
> 4 4
> 5 5
>
> After that we got an answer: 4
>
> So there are two problems:
>
> 1. The first line of input in the debug I/O window is ignored.
> 2. We must enter a lot of new lines before the program being debugged
> will read them from input and continue.
>
> For example, we can enter such data in the debug I/O window:
>
> <ENTER>
> 2 2<ENTER>
> <ENTER>
> <ENTER>
> <ENTER>
>
> And only after entering this five lines we will get an answer: 4.
>
> Is it possible to correct the problem?
>
> I will use Windows XP, Python 3.1.1 ang WingIDE 101 3.2.4.
> Also I am using Linux, and have a same problems under Linux.
>   

Wing IDE's integrated Debug I/O tool apparently has buffering problems 
under Python 3.x. A workaround is to use an external console, which you 
can configure from the Options menu in the Debug I/O tool. Also, Python 
2.x works.

I will look into fixing this for our next minor release.

Thanks,

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com




More information about the wingide-users mailing list