1

what I am trying to do is use a dictionary of references to functions. what I want to do is something like

alive = {var1: <someFunction>, var2: <someOtherFunction>};
p = multiprocessing.Process(target=var1, args=(<someArgs>))

I want var1 to be a reference to a function either in the .py file or in one that is in a given location.

Does anyone have any pointers to source code, tutorials, or the like?

2 Answers 2

1

How about:

alive = {'var1': <someFunction>, 'var2': <someOtherFunction>}
p = multiprocessing.Process(target=alive['var1'], args=(<someArgs>))
Sign up to request clarification or add additional context in comments.

Comments

1

you can call that function by importing your eg.py file

import eg

eg.var1()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.