4 ms·
The point is that you can do things like create external processes, pipe them together, redirect output to files, with the same ultra-lightweight syntax of bash
by da39a3ee 4y ago
The point is that you can do things like create external processes, pipe them together, redirect output to files, with the same ultra-lightweight syntax of bash etc. Compare that to all the nonsense you have to do in Node or Python to pipe two processes together!
- gorgoiler 4y agoYou’re right in that writing Python using shell paradigms is awful. Writing Python that shells out to do stuff — but using Python paradigms — isn’t so bad. Particularly if you are used to calving off your shell stuff into shell functions that run something and massage the output. In Python you end up doing something pretty similar: yield the text you want and use that as arguments to the next call to subprocess.run. Basically “| xargs command” but nicer.
- feanaro 4y agoThis is a thing: https://pypi.org/project/plumbum/ https://pypi.org/project/plumbum/