'indent'ing Python in windows bat

David Smith davids at invtools.com
Wed Sep 19 08:27:20 EDT 2012


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 multitude of small files is high, though, and I realized I had better
>> go to a mix.
>
> In order to achieve this, it might be very useful to either have a
> module for each (bigger) part to be achieved which you can call with
...

> Or you have one big "interpreter" which works this way:
>
> class Cmd(object):
>      """
>      Command collector
>      """
...
...
>
> This is suitable for many small things and can be used this way:
...
> Thomas

Thomas,
Beautiful. Gotta love it. I'll see if I can get the "interpreter" going. 
I particularly like it because I will be able to copy and paste 
wholesale when I stitch the final product back together again. Many thanks.

Going back to the one-liner, I discovered the following individual lines 
work:
print('hi')
if 1: print('hi')
print('hi');print('hi2')
if 1: print('hi');print('hi2')

but not:
print('hi');if 1: print('hi')

Chokes on the 'if'. On the surface, this is not consistent.

I'll drop the one-liners for now since I have something that I can work 
with as I learn to wrestle with Python.

thanks again.



More information about the Python-list mailing list