Back to main.

Calmcode Shorts

parallel logoparallel


You can learn more about parallel by checking their documentation page.

If you're on a mac you can install the tool via;

brew install parallel

On many linux distributions you should be able to install it via;

apt-get install parallel

You can confirm the installation command for your linux distribution.


The file in this video has the following contents.

import sys
import time

if __name__ == "__main__":
    i = int(sys.argv[1])
    print(f"these are the input settings: {sys.argv}")

If you want to run this file sequentially you can use xargs.

seq 10 | xargs -n 1 python

If you want to run it in parallel, you should use parallel instead.

seq 50 | parallel -j 12 python

Back to main.