A syntax idea for one-liners
Donald 'Paddy' McCarthy
paddy3118 at blueyonder.co.ukNOTthisBIT
Mon May 26 02:48:25 EDT 2003
marshall wrote:
>>Beni Cherniavsky wrote:
>>
>>> if a: if b: c;; if d: e;;; f; h
>>
<<SNIP>>
> Wouldn't it be easier to just use a routine that converts the above to
> current Python syntax and apply it in the special cases you mentioned?
>
> Marshall
Now I like that idea, you could write a module with a short name that
when imported could read an option for the oneliner, transform then exec it.
python -e 'import L1' -L1 'if a: if b: c;; if d: e;;; f; h'
But then, I personally don't think there is much use for a python
one-liner when working using a Unix or Cygwin shell as I do.
bash/perl/tcsh/zsh are good at what they do because they can express so
much in a one-liner. Python might have to be warped too much to get
similar capabilities.
- Paddy.
More information about the Python-list
mailing list