Python: how to debug a multiprocessor? (using eclipse + pydev)

I saw a couple of questions on this topic, but I did not get a complete answer ...

My code is basically:

from multiprocessing import Process p = Process(target=f).start() p.join() def f(): print 'break!' 

And I want to set a breakpoint on print . I am using pydev + eclipse (on Ubuntu).

+6
source share
1 answer

Since the new process itself is not controlled by PyDev, you need to manually debug PyDev using remote debugging tools.

http://pydev.org/manual_adv_remote_debugger.html

Use pydevd.set_trace () - note that your breakpoints will not work (not sure if this has changed recent versions of PyDev), but you need to manually enter the set_trace () command in your code.

+9
source

Source: https://habr.com/ru/post/892936/


All Articles