Anything about Java, WebLogic, OSB, Linux etc.... this is my logbook of a navigation in the IT Technology ocean.
Tuesday, September 2, 2014
Python: run multiple processes in parallel and wait for completion
This code is quite minimalistic but it works really well. It employs a very old API which is compatible with Pythong 2.1 (WLST very old version of Python....)
from sets import Set
processes = Set()
for command in commandlistlist:
print "running", command
processes.add(os.popen(command))
#wait until all processes have completed
for proc in processes:
proc.read()
No comments:
Post a Comment
comments where you are promoting your business will be marked as SPAM :o)