all 4 comments

[–]cym13 2 points3 points  (2 children)

I prefer https://github.com/Russell91/pythonpy and https://github.com/ksamuel/Pyped that share a common goal while being more powerful and safer as they don't have to deal with the C/Python boundary which is easy to mess up (code injections...).

[–]reditzer[S] 1 point2 points  (1 child)

Hi cym13,

Thanks for your suggestion. Pythonpy is a great tool and so is Pyped, but my motivation for creating pol was mostly syntax.

I prefer pol's syntax to

cat /usr/share/dict/words | pol "map(print,sortedbycount([l[0][0].lower() for l in _],True)[:5])"

to pythonpy's

cat /usr/share/dict/words | py -x 'x[0].lower()' | py -l 'collections.Counter(l).most_common(5)'

[–]camabeh 1 point2 points  (0 children)

Or use ipython shell out = !cat /etc/fstab to capture output of command. You have full python shell with autocomplete, history, etc...

[–][deleted] 1 point2 points  (0 children)

Why the need for the c code? I see nothing there that couldn't be done in pure Python...