Jason Friedman wrote:
>> 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'
On 2012-09-19 14:18, Terry Reedy wrote:
stating correctly that it works for exec().
My mistake. I fancied you were talking shell, not python. I now see that
Python 3 has exec() as a built-in.
python -c "exec('print(\"hi\")\nif 0:\n print(\"hi\")\nelif 1:\n
print(\"hi2\")')"
worked right of
On 19/09/12 19:51:44, Albert Hopkins wrote:
> On Tue, 2012-09-18 at 22:12 -0600, Jason Friedman wrote:
>>> 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 sy
On 9/19/2012 8:27 AM, David Smith wrote:
but not:
print('hi');if 1: print('hi')
Chokes on the 'if'. On the surface, this is not consistent.
Yes it is. ; can only be followed by simple statements. The keyword for
compound statememts must be the first non-indent token on a line. That
is why I
On Tue, 2012-09-18 at 22:12 -0600, Jason Friedman wrote:
> > 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
On 2012-09-19 05:22, Thomas Rachel wrote:
Am 18.09.2012 15:03 schrieb David Smith:
I COULD break down each batch file and write dozens of mini python
scripts to be called. I already have a few, too. Efficiency? Speed is
bad, but these are bat files, after all. The cost of trying to work with
a
Am 18.09.2012 15:03 schrieb David Smith:
I COULD break down each batch file and write dozens of mini python
scripts to be called. I already have a few, too. Efficiency? Speed is
bad, but these are bat files, after all. The cost of trying to work with
a multitude of small files is high, though, a
On 18/09/12 05:01:14, Ian Kelly wrote:
> On Mon, Sep 17, 2012 at 7:08 PM, David Smith wrote:
>> 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)
>
> How about:
>
> if sR == 'Cope':
> sys.exit(1)
> elif sR == 'Per
> 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=='Perfo
Thank you all. Roy Smith gets the most thanks, though he didn't answer
my general question -- he showed me how to look at that specific
structure differently. Terry Reedy might get thanks for her idea if I
can ever figure the correct escape sequences that will make both windows
and the Python i
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
>> ti
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 line
On Mon, Sep 17, 2012 at 8:28 PM, Dennis Lee Bieber
wrote:
> 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
David Smith wrote:
>
>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)
In article ,
Ian Kelly wrote:
> On Mon, Sep 17, 2012 at 7:08 PM, David Smith wrote:
> > 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)
>
> How about:
>
> if sR == 'Cope':
> sys.exit(1)
> elif sR == 'Perfor
On Mon, Sep 17, 2012 at 7:08 PM, David Smith wrote:
> 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)
How about:
if sR == 'Cope':
sys.exit(1)
elif sR == 'Perform':
sys.exit(2)
else:
sys.exit(3)
I don't re
On 09/17/2012 09: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
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 "i
18 matches
Mail list logo