converting a sed / grep / awk / . . . bash pipe line into python

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Sep 3 08:23:10 EDT 2008


Roy Smith:
> No reason to limit how many splits get done if you're
> explicitly going to slice the first two.

You are probably right for this problem, because most lines are 2
items long, but in scripts that have to process lines potentially
composed of many parts, setting a max number of parts speeds up your
script and reduces memory used, because you have less parts at the
end.

Bye,
bearophile



More information about the Python-list mailing list