A syntax idea for one-liners
phil hunt
philh at cabalamat.org
Mon May 26 10:31:42 EDT 2003
On Mon, 26 May 2003 07:48:25 +0100, Donald 'Paddy' McCarthy <paddy3118 at blueyonder.co.ukNOTthisBIT> wrote:
>
>
>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'
Or better, have a python1L executable allowing you to write:
python1L 'if a: if b: c;; if d: e;;; f; h'
--
Philip Hunt <philh at cabalamat.org>
Interested in adventure holidays in Spain?
Look at: <http://www.cabalamat.org/advcon/>
More information about the Python-list
mailing list