0

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?

3
  • Where is your code? What is a terminal? Does it have a flush() method and have you tried calling it after write()? Commented Oct 29, 2016 at 12:25
  • @mhawke I'd love to show you my code, but unfortunately it is a large project and the code is heavily modulated and trying to show you "my code" isn't efficient. However I can say terminal is A GUI with tkinter, so maybe tinter isn't safe when it comes to the multiprocessing module Commented Oct 29, 2016 at 14:27
  • But surely you can come up with a MCVE? Commented Oct 29, 2016 at 14:33

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

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.