Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.04; 'skip:$ 30': 0.07; 'subject:How': 0.09; 'python': 0.09; 'lines:': 0.09; 'subject:script': 0.09; 'kurt': 0.11; "'';": 0.16; 'columns': 0.16; 'deleted:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'innermost': 0.16; 'loops': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'code,': 0.18; 'defined': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'right.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'lines': 0.28; 'chris': 0.28; 'changed.': 0.29; 'starts': 0.29; 'code': 0.31; '(and': 0.32; 'yours,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'replaced': 0.35; 'received:209.85.220': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'item': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '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=mCKRoi+qBXTQKs2fXhLGfEsn7VZw4RPKCJ4K+l3Aj5E=; b=HUjVnTvYI84IUFFngQmBfh7j36CW5YMnsk0C2RebNx8EZ11x88OVGVf4xt7LdUNkPQ RkFRrPGeyBEe6DJUnaXUi33x1W2r+OB9DjfSPGbE2n1ndMPMynOvwFU1VO5yIJaSj5mH h72k8nBBuDYMahx++4Rdet9AS7Ao78Y9jfnJvpWv7G82Sx6rS/S97G1ZK2cFP3BQD3Wb BmVlaXh0xkzjtpDrg2e8/zZwR0RuIb4RZybcwzdfcTJ5fIJHPi3oKLeHyAHDrQIgGlgr wHFJh6YtapGNhyGquh5ZYLRMVeBbvhTkPaWmQvJxHGLiAaPiyRlBJ4EHtmrwGGJc019j +Z+A== MIME-Version: 1.0 In-Reply-To: <50e97d82$0$294$14726298@news.sunsite.dk> References: <50e97123$0$294$14726298@news.sunsite.dk> <50e97d82$0$294$14726298@news.sunsite.dk> Date: Mon, 7 Jan 2013 00:44:13 +1100 Subject: Re: How to modify this script? From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357479855 news.xs4all.nl 6904 [2001:888:2000:d::a6]:49163 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36248 On Mon, Jan 7, 2013 at 12:34 AM, Kurt Hansen wrote: > "innermost"? I have replaced this with yours, but all the marked text are > deleted: Here's the full code, with my change: $< lines = $GEDIT_SELECTED_TEXT.split("\n"); output = '\n'; for line in lines: output += ''; columns = line.split("\t"); for item in columns: output += '' + item + ' ' output += '\n'; output += ''; return output > It's only one line of code that needs to be changed. Python loops (and other control structures) are defined by indentation, so the innermost loop is the one that starts furthest to the right. Chris Angelico