-
- if __name__ == '__mp_main__':
- import sys
- sys.path = ['', '/home/arigo/pypysrc', '/home/arigo/lib/python', '/opt/pypy3/lib_pypy/__extensions__', '/opt/pypy3/lib_pypy', '/opt/pypy3/lib-python/3', '/opt/pypy3/lib-python/3/lib-tk', '/opt/pypy3/lib-python/3/plat-linux2', '/home/arigo/.local/lib/python3.5/site-packages', '/opt/pypy3/site-packages']
-
- import multiprocessing as mp
- import time
-
- def foo(x):
- return x**2
-
- if __name__ == '__main__':
- mp.set_start_method('spawn')
- mp.set_executable('/usr/bin/pypy3')
-
- pool = mp.Pool(1)
- pool.apply_async(foo, args=(12,), callback=print)
- time.sleep(1)
-