batch_on_files.py
def processTasks(self, post_UIfunc=None):
        """
        Start the execution of tasks by the processes.
        """
        self.keepgoing = True

        self.timeStart = time.time()
        # Set the initial process time for each
        for n in range(self.numprocesses):
            pid_str = "%d" % self.Processes[n].pid
            self.processTime[pid_str] = 0.0

        # Submit first set of tasks
        if self.numprocesses == 0:
            numprocstart = 1
        else:
            numprocstart = min(self.numprocesses, self.numtasks)
        for self.i in range(numprocstart):
            wx.PostEvent(
                self._notify_window,
                WorkerEvent({"type_event": "submit_job", "pos": self.Items[self.i]}),
            )
            self.dispatcher.putTask((self.i, self.Items[self.i],) + self.Tasks[self.i])

        self.j = -1
        self.i = numprocstart - 1
        while self.j < self.i:
            # Get and print results
            output = self.getOutput()
            # Execute some function (Yield to a wx.Button event)
            if isinstance(post_UIfunc, (types.FunctionType, types.MethodType)):
                post_UIfunc(output)
            if (self.keepgoing) and (self.i + 1 < self.numtasks):
                # Submit another task
                self.i += 1
                wx.PostEvent(
                    self._notify_window,
                    WorkerEvent(
                        {"type_event": "submit_job", "pos": self.Items[self.i]}
                    ),
                )
                self.dispatcher.putTask(
                    (self.i, self.Items[self.i],) + self.Tasks[self.i]
                )

        Start the execution of tasks by the processes.
        
Start the execution of tasks by the processes.
Start the execution of tasks by the processes .
def processTasks(self, post_UIfunc=None):
        self.keepgoing = True
        self.timeStart = time.time()
        for n in range(self.numprocesses):
            pid_str = "%d" % self.Processes[n].pid
            self.processTime[pid_str] = 0.0
        if self.numprocesses == 0:
            numprocstart = 1
        else:
            numprocstart = min(self.numprocesses, self.numtasks)
        for self.i in range(numprocstart):
            wx.PostEvent(
                self._notify_window,
                WorkerEvent({"type_event": "submit_job", "pos": self.Items[self.i]}),
            )
            self.dispatcher.putTask((self.i, self.Items[self.i],) + self.Tasks[self.i])
        self.j = -1
        self.i = numprocstart - 1
        while self.j < self.i:
            output = self.getOutput()
            if isinstance(post_UIfunc, (types.FunctionType, types.MethodType)):
                post_UIfunc(output)
            if (self.keepgoing) and (self.i + 1 < self.numtasks):
                self.i += 1
                wx.PostEvent(
                    self._notify_window,
                    WorkerEvent(
                        {"type_event": "submit_job", "pos": self.Items[self.i]}
                    ),
                )
                self.dispatcher.putTask(
                    (self.i, self.Items[self.i],) + self.Tasks[self.i]
                )
def processTasks ( self , post_UIfunc = None ) : self . keepgoing = True self . timeStart = time . time ( ) for n in range ( self . numprocesses ) : pid_str = "%d" % self . Processes [ n ] . pid self . processTime [ pid_str ] = 0.0 if self . numprocesses == 0 : numprocstart = 1 else : numprocstart = min ( self . numprocesses , self . numtasks ) for self . i in range ( numprocstart ) : wx . PostEvent ( self . _notify_window , WorkerEvent ( { "type_event" : "submit_job" , "pos" : self . Items [ self . i ] } ) , ) self . dispatcher . putTask ( ( self . i , self . Items [ self . i ] , ) + self . Tasks [ self . i ] ) self . j = - 1 self . i = numprocstart - 1 while self . j < self . i : output = self . getOutput ( ) if isinstance ( post_UIfunc , ( types . FunctionType , types . MethodType ) ) : post_UIfunc ( output ) if ( self . keepgoing ) and ( self . i + 1 < self . numtasks ) : self . i += 1 wx . PostEvent ( self . _notify_window , WorkerEvent ( { "type_event" : "submit_job" , "pos" : self . Items [ self . i ] } ) , ) self . dispatcher . putTask ( ( self . i , self . Items [ self . i ] , ) + self . Tasks [ self . i ] )
Start the execution of tasks by the processes.
Start the execution of tasks by the processes .
"""
        Start the execution of tasks by the processes.
        """ # Set the initial process time for each
 # Submit first set of tasks
 # Get and print results
 # Execute some function (Yield to a wx.Button event)
 # Submit another task

self
post_UIfunc