Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'assignment': 0.07; 'computing,': 0.07; 'latter': 0.09; 'pretend': 0.09; 'subject:number': 0.09; 'cc:addr:python-list': 0.11; '"w")': 0.16; '.py': 0.16; 'default).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ioerror:': 0.16; 'repl': 0.16; 'stderr': 0.16; 'stdout': 0.16; 'wrote:': 0.18; 'basically': 0.19; 'meant': 0.20; '(the': 0.22; '>>>': 0.22; 'aug': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; "aren't": 0.24; 'him.': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'permission': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'am,': 0.29; "doesn't": 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; '"",': 0.31; 'apparently': 0.31; 'file': 0.32; '(most': 0.33; 'subject:the': 0.34; 'received:google.com': 0.35; 'combination': 0.36; "he's": 0.36; 'should': 0.36; 'skip:o 20': 0.38; 'recent': 0.39; 'most': 0.60; 'stand': 0.64; 'telling': 0.64; 'foreign': 0.74; 'obvious': 0.74; 'subject:get': 0.81; 'console,': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=8hILsqhVVWWWtO2HaI/2F9LPgLoy1PWOvVHY4tUozlg=; b=PYJ/6EQ49GvHwa8q4ZGkKvr/9+SWPHVbarAvf8QPbYaaRxoj0hrQk7jSdw1W2FoKFg V+AGeqGpg+EEnMQwlnRQPCVCJVGQy2E0PX1QSR7r+OF/uKBN7WdzY97lRPVkpzVzpyDJ zwoKW4N8zuvJZA4zUyY2zk40JCNJBqE7WrmEyAjo0BAJXt9dbNaxxQ10nvncD7YXFM1/ 2w6hV0hbBZwgZDuqPSuTwXES7f9ToB83DmJQptA6RtAdkwKroOoYwpjfyhU7sXrHRRyJ AtJ1cLoMIMTF19G6KfOaVkjFSIBPRvrOM4n7KQd/hufCyTLkPw1NFrKhFLJHBsrxL2Ph btGw== MIME-Version: 1.0 X-Received: by 10.42.216.148 with SMTP id hi20mr26998467icb.12.1407698445310; Sun, 10 Aug 2014 12:20:45 -0700 (PDT) In-Reply-To: <87tx5kf987.fsf@elektro.pacujo.net> References: <53E658CD.5020904@gmail.com> <53e59035$0$29998$c3e8da3$5496439d@news.astraweb.com> <338e8fb0-c9ec-462a-b560-1c1ff77de17e@googlegroups.com> <154cc342-7f85-4d16-b636-a1a953913c98@googlegroups.com> <8c41d779-0c26-430a-a915-08c2b962e0e7@googlegroups.com> <87tx5kf987.fsf@elektro.pacujo.net> Date: Mon, 11 Aug 2014 05:20:45 +1000 Subject: Re: how to get the ordinal number in list From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407698448 news.xs4all.nl 2958 [2001:888:2000:d::a6]:45999 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76001 On Mon, Aug 11, 2014 at 5:14 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> In computing, assignment and reassignment aren't at all problematic, >> and neither is printing to the console, so please stop telling people >> off for using them. > > Printing to the console is somewhat problematic: > > >>> with open("/dev/console", "w") as console: console.write("hello\n") > ... > Traceback (most recent call last): > File "", line 1, in > IOError: [Errno 13] Permission denied: '/dev/console' Har har :) I meant printing to the single most obvious destination, which is a combination of stdout and stderr (the latter for error tracebacks, by default). What he's saying is basically "print is EVIL, so do everything with the REPL, and pretend that the P in REPL doesn't stand for print". Apparently the idea that code should work from a .py file is foreign to him. ChrisA