I have a program with an object trm of terminal, and terminal has the function write() which writes a string to a GUI. I am passing this object into a an object of multiprocessing.Process, however when I call the function write() within this process, it doesn't work. Nothing happens.
What is going on?
1 Answer
Are you passing the trm object as the target of the multiprocessing.Process? As long as I know, the target should be a callable. In this case, you should be passing trm.write as the target of the process, not trm. If you need to pass arguments to the target, you can pass through the args parameter, which gets a tuple of arguments that will be passed to your target.
terminal? Does it have aflush()method and have you tried calling it afterwrite()?terminalis A GUI with tkinter, so maybe tinter isn't safe when it comes to the multiprocessing module