Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29406
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: 'indent'ing Python in windows bat |
| Date | 2012-09-17 23:28 -0400 |
| Organization | > Bestiaria Support Staff < |
| References | <mailman.3021.1347928001.27097.python-list@python.org> <5057C990.8080809@invtools.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.855.1347938926.27098.python-list@python.org> (permalink) |
On Mon, 17 Sep 2012 21:08:32 -0400, David Smith <davids@invtools.com>
declaimed the following in gmane.comp.python.general:
>
> 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)
>
If the sole purpose of the BAT file is to set return codes, I
wouldn't bother using Python... Python is /not/ a shell language
substitute (On an IBM or Amiga, (A)Rexx is a closer match for a shell
language replacement -- since any "statement" that is not recognized as
a Rexx instruction would be passed the "current" command processor
[shell]).
Invoking the whole Python interpreter to run a "one-liner" argument
is highly inefficient, and in the end, rather futile.
Either convert the entire BAT file into a single multi-line Python
script, or don't bother.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: 'indent'ing Python in windows bat Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-17 23:28 -0400
csiph-web