Python: Snippet Multiprocessing mit Ergebnis

Beispiel für Parallelisierung von Jobs mit Ergebnis welche als Liste zurückgegeben werden. #!/usr/bin/env python # -*- encoding: utf-8; py-indent-offset: 4 -*- import os from multiprocessing import Pool def worker(job): x, y = job result = x ** y return os.getpid(), result if __name__ == ‚__main__‘: jobs = [(1, 2), (3, 4), (5, 6), (11, 12), … Weiterlesen