Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36238

Re: How to modify this script?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'output': 0.04; 'subject:How': 0.09; 'subject:script': 0.09; 'kurt': 0.11; 'advance.': 0.15; '11:42': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'innermost': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'header:In-Reply-To:1': 0.25; 'replace': 0.27; 'to?': 0.27; 'message-id:@mail.gmail.com': 0.27; 'cells': 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85.220': 0.35; 'table': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'thank': 0.36; 'item': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'price': 0.66; 'subject:this': 0.84; '2013': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9MqagQJx5Y+/FTWpC0LrKY2hGey/Frgt7FWkS/F9aFE=; b=rlTLsokrvrHHh3pwmxKPAgpzSEY70pFSlxXpx4y/6trLzsCUbGJmq/ac3j1E//f0eN psl0HRFgQ+kmx2MQ1HQde765wBTN3If1DTBfp85VjR5seTqYHaJXpgWIdDMC5K1g5uEh dck/Z/UYRlPXtClSpZpJpYhQIKCjFmwIS0gbYW8B+MYoL8JD5VEK4B9gkNTHh2NcKGJC CETgZflTy6nwyTqCV6S4okGIK4nZSHgNuuVpvyr/DChxq0Twg5BKmBv2k3/9asa2DgNN 7BlGKn78U4jFTHdYx6wJHNKOyV1SQEgPD9fhYmpRC7v3OWBm+RS7BdWEjpXp7kISaVeg savg==
MIME-Version 1.0
In-Reply-To <50e97123$0$294$14726298@news.sunsite.dk>
References <50e97123$0$294$14726298@news.sunsite.dk>
Date Sun, 6 Jan 2013 23:52:03 +1100
Subject Re: How to modify this script?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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>
Newsgroups comp.lang.python
Message-ID <mailman.160.1357476725.2939.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357476725 news.xs4all.nl 6937 [2001:888:2000:d::a6]:49007
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36238

Show key headers only | View raw


On Sun, Jan 6, 2013 at 11:42 PM, Kurt Hansen <kurt@ugyldig.invalid> wrote:
> Since there's only one "field" in the first line, I want this output:
>
> <tr><td colspan="3">Price table</td></tr>
>
> - insted of
>
> <tr><td>Price table</td></tr>
>
> How to? Thank you i advance.

It's actually quite simple, as long as you don't mind the junk of
colspan="1" on all the other cells. Just replace the innermost loop
with:

        for item in columns:
                output += '<td colspan="' + (4-len(columns)) + '"\>' +
item + '</td\> '

Untested, but it ought to work - as long as you never have _more_
cells in the line.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 13:42 +0100
  Re: How to modify this script? Chris Angelico <rosuav@gmail.com> - 2013-01-06 23:52 +1100
    Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 14:34 +0100
      Re: How to modify this script? Chris Angelico <rosuav@gmail.com> - 2013-01-07 00:44 +1100
        Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 15:03 +0100
          Re: How to modify this script? Chris Angelico <rosuav@gmail.com> - 2013-01-07 01:20 +1100
            Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 15:30 +0100
              Re: How to modify this script? Chris Angelico <rosuav@gmail.com> - 2013-01-07 01:41 +1100
              Re: How to modify this script? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-01-08 15:18 +0100
                Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-09 10:21 +0100
  Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-06 04:58 -0800
    Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 14:38 +0100
      Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-06 06:01 -0800
        Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 15:21 +0100
          Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-06 07:12 -0800
            Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-07 17:42 +0100
              Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-08 07:31 -0800
                Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-09 10:07 +0100
                Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-09 02:23 -0800
                Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-09 12:04 +0100
                Re: How to modify this script? chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-09 10:25 -0800
                Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-11 05:35 +0100
  Re: How to modify this script? Subimal Deb <subimal.deb@gmail.com> - 2013-01-06 06:22 -0800
    Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 15:40 +0100
      Re: How to modify this script? Chris Angelico <rosuav@gmail.com> - 2013-01-07 01:52 +1100
        Re: How to modify this script? Kurt Hansen <kurt@ugyldig.invalid> - 2013-01-06 16:05 +0100
  Re: How to modify this script? Gertjan Klein <gklein@xs4all.nl> - 2013-01-07 18:56 +0100
    Re: How to modify this script? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-01-08 15:22 +0100
      Re: How to modify this script? Gertjan Klein <gklein@xs4all.nl> - 2013-01-08 17:22 +0100

csiph-web