How to modify this script?

Chris Angelico rosuav at gmail.com
Sun Jan 6 09:41:32 EST 2013


On Mon, Jan 7, 2013 at 1:30 AM, Kurt Hansen <kurt at ugyldig.invalid> wrote:
> Den 06/01/13 15.20, Chris Angelico wrote:
>
>> On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen <kurt at ugyldig.invalid> wrote:
>>>
>>> I'm sorry to bother you, Chris, but applying the snippet with your code
>>> in
>>> Gedit still just deletes the marked, tab-separated text in the editor.
>
>
>> Ah, whoops. That would be because I had a bug in the code (that's why
>> I commented that it was untested). Sorry about that! Here's a fixed
>> version:
>>
> [cut]>
>
>> Note that it's a single line:
>>
>> output += '<td colspan="' + str(4-len(columns)) + '"\>' + item + '</td\> '
>>
>> If your newsreader (or my poster) wraps it, you'll need to unwrap that
>> line, otherwise you'll get an IndentError.
>
>
> Ahhh, I did'nt realize that. Now it works :-)
>
>> That version should work.
>
>
> It certainly does. I'll keep it and use it until at better solution is
> found. In the meantime I can just remove any unnecessary "colspan="1" with a
> macro.
>
> Thanks for your help.

Excellent! You'll find that Subimal's solution doesn't have those
colspan="1" lines, so take your pick as to which way you want to go.

ChrisA



More information about the Python-list mailing list