for p in procs:
    p.join()
print('joined')

def run_child(affinity):
    proc = psutil.Process()
print('PID: {pid}'.format(pid=proc.pid))
aff = proc.cpu_affinity()
print('Affinity before: {aff}'.format(aff=aff))
proc.cpu_affinity(affinity)
aff = proc.cpu_affinity()
print('Affinity after: {aff}'.format(aff=aff))
if __init__ == '__main__':
    spawn()
Using 100% of all cores with Python (multiprocessing)