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


Groups > comp.lang.python > #29400

'indent'ing Python in windows bat

Date 2012-09-17 21:08 -0400
From David Smith <davids@invtools.com>
Subject 'indent'ing Python in windows bat
References <mailman.3021.1347928001.27097.python-list@python.org>
Newsgroups comp.lang.python
Message-ID <mailman.851.1347930520.27098.python-list@python.org> (permalink)

Show all headers | View raw


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)

My sole result in many attempts is "Syntax Error."

Thank you for any help.

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


Thread

'indent'ing Python in windows bat David Smith <davids@invtools.com> - 2012-09-17 21:08 -0400
  Re: 'indent'ing Python in windows bat Tim Roberts <timr@probo.com> - 2012-09-17 20:59 -0700

csiph-web