redirect standard output problem

Chris Angelico rosuav at
Sat Dec 22 16:15:01 CET 2012

On Sun, Dec 23, 2012 at 2:07 AM, iMath <redstone-cold at> wrote:
> when I run it through command line ,it works ok ,but when I run it through IDLE , only print A but leave out 888
> so why ?

Because IDLE has to fiddle with stdin/stdout a bit to function. Try
adopting Dave's recommendation - you'll likely find that it then

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600
32 bit (Intel)] on win32
>>> sys.stdout is sys.__stdout__

The same in IDLE:
>>> sys.stdout is sys.__stdout__

Whenever you work in IDLE, expect that some things will be slightly
different, mostly to do with standard I/O streams. So when you post
issues that you've come across, please state that you're using IDLE -
it likely makes a difference!


More information about the Python-list mailing list