Re: 'indent'ing Python in windows bat

Discussion in 'Python' started by Dennis Lee Bieber, Sep 18, 2012.

  1. On Mon, 17 Sep 2012 21:08:32 -0400, David Smith <>
    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
    HTTP://wlfraed.home.netcom.com/
     
    Dennis Lee Bieber, Sep 18, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Smith

    'indent'ing Python in windows bat

    David Smith, Sep 18, 2012, in forum: Python
    Replies:
    0
    Views:
    155
    David Smith
    Sep 18, 2012
  2. Dave Angel

    Re: 'indent'ing Python in windows bat

    Dave Angel, Sep 18, 2012, in forum: Python
    Replies:
    0
    Views:
    219
    Dave Angel
    Sep 18, 2012
  3. Ian Kelly
    Replies:
    2
    Views:
    158
    Hans Mulder
    Sep 19, 2012
  4. Terry Reedy

    Re: 'indent'ing Python in windows bat

    Terry Reedy, Sep 18, 2012, in forum: Python
    Replies:
    0
    Views:
    557
    Terry Reedy
    Sep 18, 2012
  5. Dave Angel

    Re: 'indent'ing Python in windows bat

    Dave Angel, Sep 18, 2012, in forum: Python
    Replies:
    0
    Views:
    163
    Dave Angel
    Sep 18, 2012
Loading...

Share This Page