Christian Gollwitzer <aurio...@gmx.de> writes:

> The closest equivalent I can come up with in Python is this:
>
> ==============================
> import sys
>
> s=0
> for line in sys.stdin:
>     try:
>         s += float(line.split()[1])
>     except:
>         pass
> print(s)
> ===================================
>
>
> I don't want to cram this into a python -c " "  line, if it even is
> possible; how do you handle indentation levels and loops??
>

I agree. Perhaps we need a ‘awk’ module/package. I see that there is one
in PyPI but that was last updated in 2016.

-- 
Regards,
Pankaj Jangid

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to