The program self.p1 = multiprocessing.Process(target=self.task_copyer_auto) self.p1.start() and creates a process in which the function is called: self.p1 = multiprocessing.Process(target=self.task_copyer_auto) self.p1.start() how to make the function in this process change the variable that can be used in the main process?
- How to exchange data with the main process . - Enikeyschik
|
1 answer
Example from documentation :
from multiprocessing import Process, Value def f(n): n.value = 3.1415927 if __name__ == '__main__': num = Value('d', 0.0) p = Process(target=f, args=(num,)) p.start() p.join() print(num.value) |