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


Groups > comp.lang.python > #29411 > unrolled thread

Re: 'indent'ing Python in windows bat

Started byDave Angel <d@davea.name>
First post2012-09-18 01:16 -0400
Last post2012-09-18 01:16 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: 'indent'ing Python in windows bat Dave Angel <d@davea.name> - 2012-09-18 01:16 -0400

#29411 — Re: 'indent'ing Python in windows bat

FromDave Angel <d@davea.name>
Date2012-09-18 01:16 -0400
SubjectRe: 'indent'ing Python in windows bat
Message-ID<mailman.860.1347945408.27098.python-list@python.org>
On 09/18/2012 01:08 AM, Terry Reedy wrote:
> 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.
>

Don't forget, the OP uses Windows.  Last I looked, the cmd processor had
miserable escaping features.  But I could easily be wrong --  I haven't
used Windows deliberately for quite a while now.



-- 

DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web