Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug python scripts that fork

In perl debugger I can use DB::get_fork_TTY() to debug both parent and child process in different terminals. Is there anything similar in python debugger? Or, is there any good way to debug fork in python?

like image 702
vicshen Avatar asked Nov 27 '22 20:11

vicshen


1 Answers

You can emulate forked process if you will set instead of fork and its condition (pid == 0) always True. For debugging main process debugger will work.

For debugging multi-processing interaction better to use detailed logs as for me

like image 78
varela Avatar answered Dec 06 '22 19:12

varela