do python's nifty indentation rules spell the death of one-liners?
Anton Muhin
antonmuhin at sendmail.ru
Thu Apr 17 04:52:18 EDT 2003
Evan Simpson wrote:
> Garry Knight wrote:
>
>> Maybe I didn't completely understand what the OP meant, but this isn't a
>> one-liner. It's a five-liner.
>
>
> python -c """exec('''print 2$$for i in (1,4):$$ print
> i$$'''.replace('$$','\n'))"""
>
> Yech,
>
> evan @ 4-am
>
>
>
Sorry for posting it as a reply to Evan's message...
Back to OP's problem: I'd personally prefer to write a small .py file
and reduce all the one-liners to calls of functions from this module.
hth,
Anton.
More information about the Python-list
mailing list