Parallel – shell tool for executing jobs in parallel using one or more computers
gnu.org
gnu.org
#!/usr/bin/python
print(
"""Acknowledgments: This Python[1] script runs on Linux[2] based operating systems
and uses the ls (see list-segments[3]) utility, written in the ANSI C[4] language.
[1] Python programming language, Van Rossum et al., 1991-
[2] Linux kernel, Torvalds et al., 1991-
[3] Multics operating system, Corbató et al., 1969-
[4] C Programming Language 2nd. ed., Kernighan, Ritchie, 1988""")
...I don’t actually remember the problem but possibly something to do with how output is handled.
cat args | parallel this-program {}
parallel this-program {} ::: arg1 arg2 arg3 ...
The only really new thing is ::: which separates the program from the arguments if you want to give them directly.Can you show what the syntax should be for it to be intuitive to you?
This, and the obnoxious cite requirement, is why I recommend avoiding it. Use xargs -j for simple cases, and python scripts for a more complex ones. Parallel execution in python is pretty simple, and often requires no locks at all thanks to GIL.