Re: 'indent'ing Python in windows bat

Discussion in 'Python' started by Terry Reedy, Sep 18, 2012.

  1. Terry Reedy

    Terry Reedy Guest

    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
     
    Terry Reedy, 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:
    147
    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:
    164
    Dave Angel
    Sep 18, 2012
  3. Ian Kelly
    Replies:
    2
    Views:
    150
    Hans Mulder
    Sep 19, 2012
  4. Dennis Lee Bieber

    Re: 'indent'ing Python in windows bat

    Dennis Lee Bieber, Sep 18, 2012, in forum: Python
    Replies:
    0
    Views:
    176
    Dennis Lee Bieber
    Sep 18, 2012
  5. Dave Angel

    Re: 'indent'ing Python in windows bat

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

Share This Page