Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'data:': 0.07; 'subject:file': 0.07; 'try:': 0.07; 'to:addr:comp.lang.python': 0.09; 'url:%s': 0.09; 'cc:addr:python- list': 0.10; 'hits': 0.16; 'idea:': 0.16; 'row': 0.16; 'url)': 0.16; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'subject:end': 0.29; 'subject:some': 0.29; 'skip:s 30': 0.33; 'subject: .': 0.33; 'subject:data': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'except': 0.36; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'subject:-': 0.40; 'compete': 0.65; 'url:show': 0.84 X-Received: by 10.49.120.67 with SMTP id la3mr3318611qeb.12.1362638525665; Wed, 06 Mar 2013 22:42:05 -0800 (PST) Newsgroups: comp.lang.python Date: Wed, 6 Mar 2013 22:42:05 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.68.127.128; posting-account=DYJQ-woAAACEPH85Au2BhUVfFTfSfVa4 References: <7e0a8562-9a48-4f5a-804d-3751733288f0@googlegroups.com> <009ab803-6269-453b-bff1-0c58a6db358d@googlegroups.com> <0d58f312-9259-407d-b47b-80b88cf9a82c@googlegroups.com> <5bfc6644-388f-4469-a591-63fb8070faa2@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 94.68.127.128 MIME-Version: 1.0 Subject: Re: Inserting-embedding some html data at the end of a .py file From: =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?= To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 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: , Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362638528 news.xs4all.nl 6847 [2001:888:2000:d::a6]:41050 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40709 The whole try stement is as follows to have the compete idea: try: cur.execute( '''SELECT url, hits FROM counters ORDER BY hits DESC''' ) data = cur.fetchall() for row in data: (url, hits) = row print( "
%s " ) % (url, url) print( "
%s " ) % (hits) except MySQLdb.Error, e: print( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )