Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.unit0.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'value,': 0.03; 'error:': 0.05; 'column': 0.07; 'data:': 0.07; 'try:': 0.07; '"%s"': 0.09; "'''": 0.09; 'rows': 0.09; 'to:addr:comp.lang.python': 0.09; 'tuple': 0.09; 'url:%s': 0.09; 'cc:addr:python-list': 0.10; 'passing': 0.15; 'hits': 0.16; 'item)': 0.16; 'only?': 0.16; 'row': 0.16; 'seperate': 0.16; 'subject:Formatting': 0.16; 'sys.exit(0)': 0.16; 'twice.': 0.16; 'string': 0.17; 'string,': 0.17; 'variables': 0.17; 'variable': 0.20; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'print': 0.32; 'skip:s 30': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'received:209.85.220': 0.35; 'too.': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'next': 0.35; 'except': 0.36; 'michael': 0.36; 'but': 0.36; 'method': 0.36; 'display': 0.36; 'two': 0.37; 'item': 0.37; 'received:209': 0.37; 'far': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'apply': 0.39; 'link': 0.60; 'telling': 0.61; 'skip:= 30': 0.64; '8bit%:100': 0.70; '8bit%:92': 0.70; '2013': 0.84; 'subject:value': 0.84; 'url:show': 0.84 X-Received: by 10.49.94.129 with SMTP id dc1mr2002270qeb.22.1359277465310; Sun, 27 Jan 2013 01:04:25 -0800 (PST) Newsgroups: comp.lang.python Date: Sun, 27 Jan 2013 01:04:25 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.68.70.179; posting-account=DYJQ-woAAACEPH85Au2BhUVfFTfSfVa4 References: <6ad78df4-0ec0-4760-8f5a-5ecf129c5e65@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 94.68.70.179 MIME-Version: 1.0 Subject: Re: Formatting a column's value output From: Ferrous Cranus To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359277473 news.xs4all.nl 6970 [2001:888:2000:d::a6]:55889 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37763 =CE=A4=CE=B7 =CE=9A=CF=85=CF=81=CE=B9=CE=B1=CE=BA=CE=AE, 27 =CE=99=CE=B1=CE= =BD=CE=BF=CF=85=CE=B1=CF=81=CE=AF=CE=BF=CF=85 2013 12:26:44 =CF=80.=CE=BC. = UTC+2, =CE=BF =CF=87=CF=81=CE=AE=CF=83=CF=84=CE=B7=CF=82 Michael Torrie =CE= =AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > A tuple is one method for passing variables into the string formatter. >=20 > So if you need to display something twice, just put in two "%s" in the >=20 > format string, and pass it the same variable twice. Yes i know what a tuple is, iam just telling that the next code: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D try: cur.execute( '''SELECT URL, hits FROM counters ORDER BY hits DESC''' ) except MySQLdb.Error, e: print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] ) else: data =3D cur.fetchall() =09 for row in data: print ( "" ) =09 for item in row: print( ''' %s ''' %= (item, item) ) =09 sys.exit(0) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D 1. ruteruns a dataset 2. seperate each rows 3. itermate over the items of a row. Okey, so far BUT i want the url linking to happen only for the URL column's= value, and not for the hits column too. How do i apply the url link to the= URL column's value only?