Child processes created with python multiprocessing module won't print

前端 未结 4 1386
情歌与酒
情歌与酒 2020-11-27 08:12

I have a problem with the code below, and with any code that uses the print function in the child processes. I can\'t see any printed statements, even if I use

4条回答
  •  庸人自扰
    2020-11-27 08:37

    Having run into this issue myself, sometimes this can be because the child process is actually silently failing before ever getting to the print statement. If this is the case, wrapping the child process code in a try-except block and returning the exception object (to be printed in the parent process) is an effective way to debug this.

提交回复
热议问题