0

I've been trying to create a program that split few different section of my main OpenCV program to increase fps. The first thing i ever think of is the Pipe() function from my friend. I've tried this 'default' code below in python 2.7 on Windows 10 to learn the basic first of multiprocessing:

from multiprocessing import Process, Pipe

def f(conn):
    conn.send([42, None, 'hello'])
    conn.close()

if __name__ == '__main__':
    parent_conn, child_conn = Pipe()
    p = Process(target=f, args=(child_conn,))
    p.start()
    print (parent_conn.recv())   # prints "[42, None, 'hello']"
    p.join()

After that i went to Raspberry Python 3 to do the same thing, but nothing happen in Python console when i tried to run it.

the console cursor just sit there doing nothing beside blinking, but when i try to run it from terminal by typing Python and followed by file directory, the text just appear like nothing happen.

I don't know why, but i'm definitely missing something here. can i actually run this on Python 3? and why the text are not shown in Console that called from IDLE?

0

In sort. No, you cannot modify IDLE easy enough without dismantle IDLE core code or something. Instead, you can use Geany (in raspberry or linux stuff) or Notepad++ with your own RUN-command.

But with a drawback, even this is not in the scope of question. See, the Geany and Notepad++ is only for printing stuff in multiprocessing or multithreading code. It's not mean to be a debugger or some sort.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.