[EdLUG] Mixing shell and Python

Thomas Kluyver thomas at kluyver.me.uk
Tue Feb 2 21:38:59 UTC 2021


Following our conversation about bash & Python, I remembered another tool that might be of interest:

https://github.com/hauntsaninja/pyp

This lets you use Python from bash, for pipelines like:

ps x | pyp 'line.split()[4]'

For context, the conversation in today's meeting encompassed Tai's blog post about using shell style pipelines of commands in Python (https://dev.to/taikedz/shellpipe-shellpipe-py-is-exactly-what-you-think-12bi ) and the xonsh shell (https://xon.sh/ ) which mixes shell-like syntax with Python.

Thomas



More information about the EdLUG mailing list