Hello World

Albert van der Horst albert at spenarnc.xs4all.nl
Thu Jan 8 07:43:33 EST 2015


In article <mailman.17077.1419144290.18130.python-list at python.org>,
Chris Angelico  <rosuav at gmail.com> wrote:
>On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> Just to be clear, writing to sys.stdout works fine in Idle.
>>>>> import sys; sys.stdout.write('hello ')
>> hello  #2.7
>>
>> In 3.4, the number of chars? bytes? is returned and written also.
>>
>> Whether you mean something different by 'stdout' or not, I am not sure.  The
>> error is from writing to a non-existent file descriptor.
>
>That's because sys.stdout is replaced. But stdout itself, file
>descriptor 1, is not available:
>
>>>> os.fdopen(1,"w").write("Hello, world\n")
>Traceback (most recent call last):
>  File "<pyshell#4>", line 1, in <module>
>    os.fdopen(1,"w").write("Hello, world\n")
>OSError: [Errno 9] Bad file descriptor

I don't trust sudo because it is too complicated.
(To the point that I removed it from my machine.)
I do
su
..
#
su nobody

Who needs sudo?

It's like instead of telling a 4-year old to stay on the
side walk, learning him to read and then give him a 8-page
brochure about "safety in traffic".


>
>This works fine in command-line Python, just not in IDLE. It's not
>Windows vs Unix, it's Idle vs terminal.
>
>ChrisA

Groetjes Albert
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst




More information about the Python-list mailing list