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? -

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

ajax - PHP/JSON Login script (Twitter style) not setting sessions -