parallel -k python a1.py {} ::: {0..50..2}

In the a1.py, I have some print statement.

Running the parallel command doesn't show the print statement of my python-script. Is there any way for parallel to show the intermediate print command?


-k forces GNU Parallel to keep the order, so first you get the output of job 1, and when job 1 finishes, only then do you get job 2.

You can follow job 1's progress with --linebuffer:

parallel -k --linebuffer python a1.py {} ::: {0..50..2}

If you want to follow all jobs' progress, then you cannot keep the order:

parallel --linebuffer python a1.py {} ::: {0..50..2}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.