Q: can python be used as scripting language?

SO #1

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

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.

SO #2

https://unix.stackexchange.com/questions/176091/how-can-i-replace-bash-with-python

their answer: use IPython

Plumbum

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.

9/5/2020:

https://www.linuxjournal.com/content/python-scripts-replacement-bash-utility-scripts (2013)

https://medium.com/capital-one-tech/bashing-the-bash-replacing-shell-scripts-with-python-d8d201bc0989 (2017)

and maybe: https://xon.sh gitter: https://gitter.im/xonsh/xonsh

so there.