Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37763
| 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 | <nikos.gr33k@gmail.com> |
| 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 | <mailman.1090.1359239220.2939.python-list@python.org> |
| 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> <mailman.1086.1359223462.2939.python-list@python.org> <d543dccf-af7a-4efd-adc5-13d9ef080c1e@googlegroups.com> <mailman.1090.1359239220.2939.python-list@python.org> |
| 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 <nikos.gr33k@gmail.com> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Message-ID | <mailman.1107.1359277473.2939.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
Τη Κυριακή, 27 Ιανουαρίου 2013 12:26:44 π.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > A tuple is one method for passing variables into the string formatter. > > So if you need to display something twice, just put in two "%s" in the > > format string, and pass it the same variable twice. Yes i know what a tuple is, iam just telling that the next code: ================================ 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 = cur.fetchall() for row in data: print ( "<tr>" ) for item in row: print( '''<td> <a href='http://www.%s?show=log'>%s</a> </td>''' % (item, item) ) sys.exit(0) ================================= 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?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-26 09:51 -0800
Re: Formatting a column's value output Chris Angelico <rosuav@gmail.com> - 2013-01-27 05:04 +1100
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-26 11:41 -0800
Re: Formatting a column's value output Michael Torrie <torriem@gmail.com> - 2013-01-26 15:26 -0700
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-27 01:04 -0800
Re: Formatting a column's value output Chris Angelico <rosuav@gmail.com> - 2013-01-27 20:08 +1100
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-27 01:16 -0800
Re: Formatting a column's value output Chris Angelico <rosuav@gmail.com> - 2013-01-27 20:26 +1100
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 01:30 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 01:30 -0800
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-27 01:16 -0800
Re: Formatting a column's value output rurpy@yahoo.com - 2013-01-27 08:12 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 10:05 -0800
Re: Formatting a column's value output Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-27 13:36 -0500
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 10:44 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 10:44 -0800
Re: Formatting a column's value output rurpy@yahoo.com - 2013-01-27 11:12 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-27 12:24 -0800
Re: Formatting a column's value output Mitya Sirenef <msirenef@lightbird.net> - 2013-01-27 15:50 -0500
Re: Formatting a column's value output rurpy@yahoo.com - 2013-01-27 14:27 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-28 01:47 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-28 01:44 -0800
Re: Formatting a column's value output Κώστας Παπαδόπουλος <nikos.gr33k@gmail.com> - 2013-01-28 01:44 -0800
Re: Formatting a column's value output Virgil Stokes <vs@it.uu.se> - 2013-01-27 18:46 +0100
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-27 01:04 -0800
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-26 11:41 -0800
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-26 13:07 -0800
Re: Formatting a column's value output Chris Angelico <rosuav@gmail.com> - 2013-01-27 09:18 +1100
Re: Formatting a column's value output alex23 <wuwei23@gmail.com> - 2013-01-26 15:29 -0800
Re: Formatting a column's value output Chris Angelico <rosuav@gmail.com> - 2013-01-27 10:38 +1100
Re: Formatting a column's value output Jason Friedman <jsf80238@gmail.com> - 2013-02-03 09:18 -0800
Re: Formatting a column's value output Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-04 06:39 +0000
Re: Formatting a column's value output Ferrous Cranus <nikos.gr33k@gmail.com> - 2013-01-26 13:07 -0800
csiph-web