Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'heavily': 0.04; 'things.': 0.05; 'completeness': 0.07; 'important,': 0.07; 'subject:question': 0.08; 'python': 0.09; '===': 0.09; 'advice.': 0.09; 'code"': 0.09; 'received:155': 0.09; 'stdout': 0.09; 'subject:files': 0.09; 'sure,': 0.09; 'yeah,': 0.09; 'bug': 0.10; '*any*': 0.16; 'bugs,': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'ensured': 0.16; 'from:addr:jpmorgan.com': 0.16; "guido's": 0.16; 'indent': 0.16; 'oct': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'silly': 0.16; 'team?': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'to:name:python-list@python.org': 0.20; 'meant': 0.21; 'minor': 0.22; 'this:': 0.23; 'received:169.254': 0.24; 'machine': 0.24; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'bugs': 0.27; 'logging': 0.27; 'updating': 0.27; 'accuracy': 0.27; 'chris': 0.28; "d'aprano": 0.29; 'indentation': 0.29; 'optional': 0.29; 'question:': 0.29; 'steven': 0.29; 'received:169': 0.29; 'worked': 0.30; 'fri,': 0.30; 'thursday,': 0.30; 'code': 0.31; 'america': 0.32; 'could': 0.32; 'to:addr:python-list': 0.33; 'fastest': 0.35; 'moved': 0.35; 'there': 0.35; 'next': 0.35; 'really': 0.36; 'subject:': 0.36; 'created': 0.36; 'except': 0.36; 'but': 0.36; 'email addr:python.org': 0.36; 'test': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'correctly': 0.37; 'october': 0.37; 'optimization': 0.37; 'sent:': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'comment': 0.38; 'to:addr:python.org': 0.39; 'space': 0.39; 'skip:" 10': 0.40; 'end': 0.40; 'think': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'most': 0.61; 'australia': 0.62; 'email name:python-list': 0.62; 'life,': 0.62; 'peace': 0.62; 'world': 0.63; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; 'sale': 0.76; 'existence.': 0.84; 'optimized,': 0.84; 'peace,': 0.84; 'received:169.254.8': 0.84; 'won': 0.96 X-DKIM: OpenDKIM Filter v2.1.3 sz4.jpmchase.com q94MaHhX013304 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1349390177; bh=ulk3zIX4psRG+hdosSDQgYhNxsuvpiaVRM66Ot3d59k=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=brUrBsC2JPdHeARgZC7XUysSRFozpwC62mTGxgHrXV41gHK1BVDgF/KX/nFRD46Tf yiHgRtha4LaNv4+s2sMaOoN+mLm9DZQLVku1S41wNEt/kyNz/TP6ufBT6TiGH9Y0vo T4rW4VbHmYF1zMnwswOIuTV02Xf9UCMiD7YOZr9Q= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: final question: logging to stdout and updating files Thread-Topic: final question: logging to stdout and updating files Thread-Index: AQHNojiaAQx11CGTEEOpqPxnEQUmqZepd2YAgABEj6A= Date: Thu, 4 Oct 2012 22:36:02 +0000 References: <506d967a$0$29978$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349392031 news.xs4all.nl 6938 [2001:888:2000:d::a6]:57481 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30754 Chris Angelico wrote:=0D=0A> Sent: Thursday, October 04, 2012 9:28 AM=0D=0A= > To: python-list@python=2Eorg=0D=0A> Subject: Re: final question: logging = to stdout and updating files=0D=0A> =0D=0A> On Fri, Oct 5, 2012 at 12:00 AM= , Steven D'Aprano=0D=0A> wrote= :=0D=0A> > That is *terrible* advice=2E But if you insist on following it, = you can=0D=0A> > optimize *any* Python program to this:=0D=0A> >=0D=0A> > #= =3D=3D=3D start code =3D=3D=3D=0D=0A> > pass # this line is optional=0D= =0A> > # =3D=3D=3D end code =3D=3D=3D=0D=0A> >=0D=0A> >=0D=0A> > There you = go=2E The most heavily optimized, fastest Python program in=0D=0A> > existe= nce=2E Sure, it has a few bugs, but boy is it fast!!!=0D=0A> =0D=0A> Not ma= ny bugs though! I ran it in my Python 5=2E2=2E7 for GNU/Windows=0D=0A> 256-= bit (err, yeah, I borrowed Guido's time machine but had the silly=0D=0A> th= ing in reverse=2E=2E=2E oops) and it worked perfectly, except that=0D=0A> i= ndentation has moved from "significant" to "mandatory"=2E When I added=0D= =0A> the necessary 5 space indent at the beginning, it correctly created=0D= =0A> world peace, ensured that Australia won the next Test Match, and then= =0D=0A> printed "Hello, world!\n" to stdout=2E Unfortunately, a bug in your= "end=0D=0A> code" comment meant that the peace it created was by wiping ou= t all=0D=0A> life, but that's pretty minor in the scheme of things=2E=0D=0A= =0D=0APython is a product for Americans! ;) It should ensure America=0D=0Aw= ins the Test Match=2E=2E=2E=2Ewait, do we even have a cricket team?=0D=0A= =0D=0A> =0D=0A> Optimization really is that important, folks!=0D=0A> =0D=0A= > ChrisA=0D=0A> may need to schedule surgical detongueing of his cheek=0D= =0A=0D=0AThink we could get a group rate for c=2El=2Ep?=0D=0A=0D=0ARamit=0D= =0A=0D=0AThis email is confidential and subject to important disclaimers an= d=0D=0Aconditions including on offers for the purchase or sale of=0D=0Asecu= rities, accuracy and completeness of information, viruses,=0D=0Aconfidentia= lity, legal privilege, and legal entity disclaimers,=0D=0Aavailable at http= ://www=2Ejpmorgan=2Ecom/pages/disclosures/email=2E