Import specific class or function in Python Parallel job -
if using modules in function passed server.submit [docs], need specify these in modules argument. see below:
import os def get_os_name(): return os.name jobserver.submit(get_os_name,modules=('os',))
but, this:
from os import name def get_os_name(): return name # won't work jobserver.submit(get_os_name,modules=('os',))
how second code chunk work? tried replace 'os' 'os.name' , stuff that, no luck.
try this:
exec("jobserver.submit(get_os_name,modules=('os',))")
Comments
Post a Comment