Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'operator': 0.03; 'interpreter': 0.04; "'python": 0.07; 'python': 0.09; "%s'": 0.09; 'handled.': 0.09; 'subject:error': 0.11; 'subject:python': 0.11; 'charset:iso-8859-7': 0.15; 'enlighten': 0.16; 'evaluating': 0.16; 'expression,': 0.16; 'expression.': 0.16; 'expressions.': 0.16; 'footnote': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'operator.': 0.16; 'subject:when': 0.16; 'wrote:': 0.17; 'code.': 0.20; 'do.': 0.21; 'effort.': 0.22; 'parse': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'first,': 0.27; 'rules': 0.27; 'message- id:@mail.gmail.com': 0.27; 'chris': 0.28; 'division': 0.29; 'second,': 0.29; 'fri,': 0.30; 'figure': 0.30; 'gets': 0.32; 'url:python': 0.32; 'generally': 0.32; 'to:addr:python-list': 0.33; 'languages': 0.33; 'version': 0.34; 'received:google.com': 0.34; 'wrong': 0.34; 'table': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'useful': 0.36; 'should': 0.36; 'available.': 0.37; 'level': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'step': 0.39; 'your': 0.60; 'skip:u 10': 0.60; 'most': 0.61; 'high': 0.61; "you'll": 0.62; 'more': 0.63; 'percent': 0.65; 'walk': 0.71; 'gain': 0.79; '2013': 0.84; 'url:reference': 0.84; '\xcc\xe1\xf1\xf4\xdf\xef\xf5': 0.84; 'step.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=qh5J4+X34unf5Yvdjhw+CJUrKrJbbBVCOvx6vMqoiyo=; b=i2DiJBZF/gbaaasWHxeVRXXprBeRMFXeB7qCxNYYb6VsdRq98N7Dx6O3R1vvc4Ym4P mfTqzE886qaoeCxnSWxP76RhNOHXSE4VYBHLBbQDHKmFjgqMYQInXB55Afx1p1r3+S+2 7nKVWW0SJf5Xl08MzSGhzfJ0X2xB0SrJsyyA6ed1dSJV+eP+LoMnrcJupKB/jjVECKyj DgYl69EJOklFkv9+WOpe+wEoGgRuY4v8lLKKho3pP+kdQrVWqqnBFLrKkx1HAFRrcxsJ 1iUfH3ORYi1uuPBgOPuQnJpsmkTqEg9AEAwN0lN3iSeZKpXzth3r1rw6t27ImFkPTo/M Lp9Q== MIME-Version: 1.0 X-Received: by 10.52.29.209 with SMTP id m17mr11469272vdh.111.1362670390687; Thu, 07 Mar 2013 07:33:10 -0800 (PST) In-Reply-To: References: <8e17232e-5b24-4040-9215-c4bd89f34fa2@googlegroups.com> <622d4a2d-0014-4254-b211-c8fd66510f74@googlegroups.com> Date: Fri, 8 Mar 2013 02:33:10 +1100 Subject: Re: An error when i switched from python v2.6.6 => v3.2.3 From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable 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: 57 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362670392 news.xs4all.nl 6977 [2001:888:2000:d::a6]:38788 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40788 On Fri, Mar 8, 2013 at 2:26 AM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: > =D4=E7 =D0=DD=EC=F0=F4=E7, 7 =CC=E1=F1=F4=DF=EF=F5 2013 5:13:24 =EC.=EC. = UTC+2, =EF =F7=F1=DE=F3=F4=E7=F2 Chris Angelico =DD=E3=F1=E1=F8=E5: >> On Fri, Mar 8, 2013 at 2:01 AM, =CD=DF=EA=EF=F2 =C3=EA=F133=EA wrote: >> >> > os.system( 'python metrites.py > %s' ) % htmltemp >> >> >> >> Manually step through what this line should do. Follow the exact same >> >> rules Python will follow in evaluating this expression. >> >> >> >> http://docs.python.org/2/reference/expressions.html#operator-precedence >> >> http://docs.python.org/3/reference/expressions.html#operator-precedence >> >> >> >> As you'll see from footnote 8 or 5 (depending on which version of the >> >> docs), your percent operator is the same one listed in the table as a >> >> division operator. >> >> >> >> Now. Go through that expression, step by step. Walk through everything >> >> the Python interpreter does. Figure out exactly what happens first, >> >> second, third. Figure out when your percent operator gets handled. >> >> Then you'll know what's wrong with that line of code. >> >> >> >> You'll also gain a very useful understanding of Python, and more >> >> generally of the way most high level languages parse expressions. >> >> >> >> ChrisA > > I'am sorry to say i cant figure this out :( > please enlight me. You can figure it out, but it will take some effort. I will not enlighten you further. The documentation is all there; the answers are available. ChrisA