Yea, IMO the best way to do this with pythonpy is:
py -l 'len(l)'
That being said, I still use wc -l every time. In fact, I always prefer regular unix commands (e.g. grep, xargs, head) to pythonpy when possible. But there are some things, such as:
py -l 'l[::2]'
which while possible with tools like sed, are just much better expressed with pythonpy.
Comments
Yea, IMO the best way to do this with pythonpy is:
That being said, I still use wc -l every time. In fact, I always prefer regular unix commands (e.g. grep, xargs, head) to pythonpy when possible. But there are some things, such as: which while possible with tools like sed, are just much better expressed with pythonpy.