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


Groups > comp.lang.python > #29410

Re: 'indent'ing Python in windows bat

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'elif': 0.04; 'essentially': 0.04; 'subject:Python': 0.05; 'newbie': 0.05; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sys.exit(2)': 0.09; 'terry': 0.09; '"import': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:windows': 0.16; 'sys.exit(1)': 0.16; 'string': 0.17; 'wrote:': 0.17; 'jan': 0.18; 'windows': 0.19; 'followed': 0.20; 'putting': 0.20; 'work.': 0.23; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'converting': 0.27; 'header:X-Complaints-To:1': 0.28; 'lines': 0.28; 'archives': 0.29; 'idea,': 0.29; 'spaces': 0.29; 'words': 0.29; "i'm": 0.29; 'aside': 0.32; 'like:': 0.33; 'problem': 0.33; 'to:addr:python- list': 0.33; 'pm,': 0.35; 'something': 0.35; 'received:org': 0.36; 'method': 0.36; 'should': 0.36; 'does': 0.37; 'quite': 0.37; 'files': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'hello,': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'most': 0.61; 'believe': 0.69; 'smith': 0.71; 'received:fios.verizon.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: 'indent'ing Python in windows bat
Date Tue, 18 Sep 2012 01:08:54 -0400
References <mailman.3021.1347928001.27097.python-list@python.org> <5057C990.8080809@invtools.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0
In-Reply-To <5057C990.8080809@invtools.com>
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.859.1347944949.27098.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347944949 news.xs4all.nl 6888 [2001:888:2000:d::a6]:38450
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29410

Show key headers only | View raw


On 9/17/2012 9:08 PM, David Smith wrote:
> Hello, I'm essentially a newbie in Python.
> My problem in searching the archives is not knowing what words to use to
> ask.
>
> I'm converting windows bat files little by little to Python 3 as I find
> time and learn Python.
> The most efficient method for some lines is to call Python like:
> python -c "import sys; sys.exit(3)"
>
> How do I "indent" if I have something like:
> if (sR=='Cope'): sys.exit(1) elif (sR=='Perform') sys.exit(2) else
> sys.exit(3)

Quite aside from whether this is  good idea, I believe putting \n 
followed by spaces or \t in the quoted string should work. It does for exec.

-- 
Terry Jan Reedy

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


Thread

Re: 'indent'ing Python in windows bat Terry Reedy <tjreedy@udel.edu> - 2012-09-18 01:08 -0400

csiph-web