Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.05; 'python': 0.09; 'stating': 0.09; 'tab': 0.09; 'terry': 0.09; ':-)': 0.13; 'closes': 0.16; 'mistake.': 0.16; 'reedy': 0.16; 'statements,': 0.16; 'subject:windows': 0.16; 'swallowed': 0.16; 'wrote:': 0.17; 'putting': 0.20; 'fine,': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'select': 0.26; 'skip:" 20': 0.26; 'separate': 0.27; 'mind.': 0.27; 'multiline': 0.29; 'prints': 0.29; 'though.': 0.29; "i'm": 0.29; 'worked': 0.30; 'file': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'said,': 0.35; 'received:192.168.0': 0.35; 'too.': 0.35; 'received:209.85': 0.35; "i'll": 0.36; 'thank': 0.36; 'correctly': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'space': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'back': 0.62; 'talking': 0.66; 'asap': 0.71; 'hoping': 0.72 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=QXlwTHFYxodXSNw8ecy8jHIGXQ4UupzwnhpAfvbOLz8=; b=MIZknNw+XCUgoFarK7QxO8Wqg9l4Iiw0T6nEiNqaLdwwcnsQ6v+HgDXGz1iy86Shid VLC2iuEdAWqbnLt1V6mAY598ZEReN4H0i3KJsLD3t++0WbC+Wi1y0C0oMNIxS4zsb/+i 3E90KQx8x8UkyZj4V/1ZjMQtWlmL2Ul10WxyTG37ePFVD3Cp9tJi+TWJxddWQTk8PaVa SrFuGCn4+buIlTPmi4le5M86sqsVlGTrjm8PcVci4tjNZTRkeeWJP25HorjKFg1/um/E nSm2n5ktdZQNNUvHH8LCAGq1zyXv6Au9GPLug5hgYPtjKhEMkQah0LYk1Oekxz+kD1BU qAWA== Date: Wed, 19 Sep 2012 16:09:50 -0400 From: David Smith User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Re: 'indent'ing Python in windows bat References: <5057C990.8080809@invtools.com> <505803A9.4000409@davea.name> <5059BA28.2090803@invtools.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlGmqBrDE8xQTfv43U737qDR39oHAYNzxOYzv9PJAwhTIXaegcFaOlFze/NAA7h6ezCn+YG 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348085390 news.xs4all.nl 6913 [2001:888:2000:d::a6]:41365 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29525 On 2012-09-19 14:18, Terry Reedy wrote: > stating correctly that it works for exec(). My mistake. I fancied you were talking shell, not python. I now see that Python 3 has exec() as a built-in. python -c "exec('print(\"hi\")\nif 0:\n print(\"hi\")\nelif 1:\n print(\"hi2\")')" worked right off the *.bat. Shades of sed! Note I used a one space indentation. A tab works fine, too. > python -c "exec('print(%1)\nif 1: print(2)')" > and calling 'tem 3' prints > 3 > 2 Thanks for the exhaustive study. :-) I'll keep it in mind. I hope I don't have to do this, though. > That said, if you have many multiline statements, putting them in a > separate file or files may be a good idea. ASAP I'm hoping to have each bat swallowed completely by python. My current "bathon" or "pytch" file closes an old session then opens the session I select just like the bat mom used to bake. Thank you again, Terry, and thanks to all -- even the *nix'ers. Might come in handy if I get back into that again.