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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -