Skip to content
Advertisement

Tag: multiprocessing

How to attach debugger to a python subproccess?

I need to debug a child process spawned by multiprocessing.Process(). The pdb degugger seems to be unaware of forking and unable to attach to already running processes. Are there any smarter python debuggers which can be attached to a subprocess? Answer Winpdb is pretty much the definition of a smarter Python debugger. It explicitly supports going down a fork, not

Log output of multiprocessing.Process

Is there a way to log the stdout output from a given Process when using the multiprocessing.Process class in python? Answer The easiest way might be to just override sys.stdout. Slightly modifying an example from the multiprocessing manual: And running it: $ ls m.py $ python m.py $ ls 27493.out 27494.out m.py $ cat 27493.out function f module name: __main__

Advertisement