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


Groups > comp.lang.python > #29525

Re: Re: 'indent'ing Python in windows bat

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 <davids@invtools.com>
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 <davids@invtools.com>
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 <mailman.3021.1347928001.27097.python-list@python.org> <5057C990.8080809@invtools.com> <k38vl8$u02$2@ger.gmane.org> <505803A9.4000409@davea.name> <mailman.870.1347973403.27098.python-list@python.org> <k3c2st$l6l$1@r03.glglgl.gl> <5059BA28.2090803@invtools.com> <k3d29n$dgd$1@ger.gmane.org>
In-Reply-To <k3d29n$dgd$1@ger.gmane.org>
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 <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.939.1348085390.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


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.

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


Thread

Re: 'indent'ing Python in windows bat David Smith <davids@invtools.com> - 2012-09-18 09:03 -0400
  Re: 'indent'ing Python in windows bat Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-19 11:22 +0200
    Re: Re: 'indent'ing Python in windows bat David Smith <davids@invtools.com> - 2012-09-19 08:27 -0400
    Re: 'indent'ing Python in windows bat Terry Reedy <tjreedy@udel.edu> - 2012-09-19 14:18 -0400
    Re: Re: 'indent'ing Python in windows bat David Smith <davids@invtools.com> - 2012-09-19 16:09 -0400

csiph-web