Paddy wrote:
> On Mar 13, 7:03 pm, Jonathan Gardner <[EMAIL PROTECTED]>
> wrote:
>> On Mar 12, 6:37 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> 
> <<Snip>>
>> And leave out the magical -p and -n. If you want to iterate through a
>> file, "for line in sys.stdin:".
> 
> Or better still:
> 
>     import fileinput
>     for line in fileinput.input():
>         process(line)

I write maybe a dozen one-liners a day.  It's not practical to do this 
with Python, or at least it's not nearly as convenient as Perl.  I'm 
fine with the magic.  Abusing the magic is another story; Perl language 
features are meant to be used in particular contexts, and BEGIN blocks 
are rarely if ever necessary in Perl modules.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to