3 ms·
> Your code sort of cheats, since it is calling xargs to do the parallelism. This is the whole point though -- you can still invoke external binaries in python
by theamk 7y ago
> Your code sort of cheats, since it is calling xargs to do the parallelism.
This is the whole point though -- you can still invoke external binaries in python!
For example, if you need to sort 100GB file, direct Python approach will likely OOM... while /usr/bin/sort will work just fine. I have seen people use this as an excuse ("I cannot use python's sort(), so I will just rewrite everything in shell") -- but for a complex script, it is almost always better to use Python as much as possible.