Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '21,': 0.07; 'cc:addr :python-list': 0.11; 'descriptor': 0.16; 'descriptor.': 0.16; 'fds': 0.16; 'idle,': 0.16; 'idle.': 0.16; 'itself,': 0.16; 'reedy': 0.16; 'replaced.': 0.16; 'stdout': 0.16; 'sure.': 0.16; 'surprises': 0.16; 'sys.stdout': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'written': 0.21; 'import': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'fine': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'dec': 0.30; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'most': 0.60; 'different': 0.65; 'to:addr:gmail.com': 0.65; '20,': 0.68; 'subject:Hello': 0.72; 'available:': 0.91; 'subject:World': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JdOb01jzZtjJ9kqrUMmtXsV0fpgmzWF2MIBZudvk5TQ=; b=g8j1DhMBaz/lE+RlicIn8fpKHEgEbOlONfLFf/AK+QfdtEVPWJ4gHAZmQxVNxrZaed eMDI617u9ScVP8xbWmoW6ac3qvrNg6ScHzbf/NIiEZ61wcnuqV8s195z7+ahEXjcexfi x5EPXaYrc7NFYt7SjeexQyH9/OyplqcRfO89aWbOUSxyACaQbyNozwNppIbTblaMWWxT GqP4c/lCGtwll1d+nsBd0EqDWIiZn9j1mh3A7YyYkLvamtKKzwIhzRQA2KMA3ShwZ+D6 JIx4rXfgmMmo/VH2422TOqZHQZ6RfcbXWyhEAzXXOVIDgYljyuhO0/tMiY+xAujp8gXi /DRg== X-Received: by 10.140.38.139 with SMTP id t11mr35251191qgt.83.1421539607110; Sat, 17 Jan 2015 16:06:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <54957226$0$12975$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Sat, 17 Jan 2015 16:06:06 -0800 Subject: Re: Hello World To: Chris Angelico Content-Type: text/plain; charset=UTF-8 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421539617 news.xs4all.nl 2835 [2001:888:2000:d::a6]:41803 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83960 Sorry for necro. On Sat, Dec 20, 2014 at 10:44 PM, Chris Angelico wrote: > On Sun, Dec 21, 2014 at 5:31 PM, Terry Reedy 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: It surprises me that IDLE, and most other shells, don't dup2 stdout/err/in so that those FDs talk to IDLE. -- Devin