from: https://stackoverflow.com/questions/209470/how-to-implement-common-bash-idioms-in-python
answer 1) don't; bash has pipes and other important things
answer 2) see these:
Take a look at these libraries which help you Never write shell scripts again (Plumbum's motto).
Aug 10, 2018; hmm..., looks interesting: has pipes, cat, other bash-like commands
Sarge https://bitbucket.org/vinay.sajip/sarge/ (blank page)
Jun 6, 2017; hmm..., another interesting take on using bash cmds from python
"The Pyed Piper", or pyp, is a linux command line text manipulation tool similar to awk or sed, but which uses standard python string and list methods as well as custom functions evolved to generate fast results in an intense production environment.
NO, sounds line spipat would do that, only better.
https://unix.stackexchange.com/questions/176091/how-can-i-replace-bash-with-python
their answer: use IPython
https://pypi.org/project/plumbum/
ok, so here goes on opan3 using my own python3 (Python 3.7.3)
06:20:43 wendell $ pip3.7 install plumbum
Installing collected packages: plumbum
Successfully installed plumbum-1.6.7
However, still apparently need popen for normal cmd.
https://www.linuxjournal.com/content/python-scripts-replacement-bash-utility-scripts (2013)
and maybe: https://xon.sh gitter: https://gitter.im/xonsh/xonsh
so there.