Syntax issue with python dictionary and multiprocessing script
Hi I am trying to be able to start a thread from a dictionary entry using
this code below. The rest of the code in the script is known good and
fully functional. I cam gonna have to be able to choose from a bunch of
different subroutines so I want to remove as much boilerplate as possible
from the code. Thanks guys and gals!!!!
class worker_manager:
i = test_imports()
template('one': i.import_1, 'two': i.import_2);
def __init__(self):
self.children = {}
def generate(self, control_Queue, threadName, runNum):
p = multiprocessing.Process(target=self.template[threadName],
args=(control_Queue, runNum))
self.children[threadName] = p
p.start()
def terminate(self, threadName):
self.children[threadName].join
When I run this code I get this error:
File "dynamicTest1.py", line 53
template('one': i.import_1, 'two': i.import_2);
^
SyntaxError: invalid syntax
Anyone have any advice?
No comments:
Post a Comment