2 ms·
> I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). I
by hoistbypetard 5y ago
> I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only.
I've only kicked the tires on both, but plumbum:
https://plumbum.readthedocs.io/en/latest/ https://plumbum.readthedocs.io/en/latest/
and sh:
https://amoffat.github.io/sh/ https://amoffat.github.io/sh/
both feel pretty good in that regard.
- mbreese 5y agoEven if you have a great library that abstracts away shell like things, you’d still probably be better served with a shell script. Shell scripts aren’t supposed to be big. They are quick one offs that solve immediate problems. This means that they are also spread around the filesystem. I’m of the opinion that one shouldn’t install libraries into the system Python path. I also tend to make heavy use of virtual envs. Setting up a venv for each off scripts doesn’t seem like a great plan. For more centralized workflows, I could see Python shell replacements being helpful. Especially project specific scripts where the overhead of managing a venv is negligible. But realistically replacing the majority of bash scripts? I just don’t see it.