4 ms·
There is futures module for Python 2.7 on PyPI. In simple cases, you could use multiprocessing.Pool(): results = pool.map(processfile, getpaths()) There is
by d0mine 9y ago
There is futures module for Python 2.7 on PyPI.
In simple cases, you could use multiprocessing.Pool():
results = pool.map(processfile, getpaths())
There is also ThreadPool. There are known issues with multiprocessing especially on Python 2.7 e.g., Ctrl+C handling.
Though you don't need threading to manage concurrent subprocesses or IO (Gevent, Twisted or curio if you use Python 3).