I have python script run.py:
def do(i):
# doing something with i, that takes time
start_i = sys.argv[1]
end_i = sys.argv[2]
for i in range(start_i, end_i):
do(i)
Then I run this script:
python run.py 0 1000000
After 30 minutes script is completed. But, it's too long for me.
So, I create bash script run.sh:
python run.py 0 200000 &
python run.py 200000 400000 &
python run.py 400000 600000 &
python run.py 600000 800000 &
python run.py 800000 1000000
Then I run this script:
bash run.sh
After 6 minutes script is completed. Rather good. I'm happy.
But I think, there is another way to solve the problem (without creating bash script), isn't there?