print()

Mark Tolonen metolone+gmane at gmail.com
Sat Oct 17 21:13:27 EDT 2009


"Terry Reedy" <tjreedy at udel.edu> wrote in message 
news:hbdh51$g0f$1 at ger.gmane.org...
> Gabriel Genellina wrote:
>
>> Presumably he's using Python 3:
>
> And apparently not IDLE
>
>> Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit 
>> (Intel)] on win32
>> Type "help", "copyright", "credits" or "license" for more information.
>> p3> import sys
>> p3> sys.stdout.write("hello")
>> hello5
>>
>> See http://bugs.python.org/issue6345
>
> IDLE
>
> Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] 
> on win32
>
> >>> import sys
> >>> sys.stdout.write('abc')
> abc
>
> reported, for better or worse, in http://bugs.python.org/issue7163
>
> Since interactive users do not usually use sys.stdout.write (versus 
> print), the mixed output is not usually a problem.
>
> tjr

Apparently, Pythonwin has the same "problem":

PythonWin 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit 
(Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for 
further copyright information.
>>> import sys
>>> sys.stdout.write('hello')
hello
>>> print(sys.stdout.write('hello'))
helloNone

-Mark 





More information about the Python-list mailing list