Debugging embedded python

"Martin v. Löwis" martin at v.loewis.de
Sun Apr 6 23:40:25 CEST 2003


Syver Enstad wrote:
> I have the python interpreter embedded in a daemon/service (this is
> win2k so it's a service). I'd really like to be able to debug the
> python code that is running. I was thinking of popping up a console
> window to be able to run pdb, how does one go about it to accomplish
> this? Are there any code doing similar things or articles.

I recommend that you find a non-daemon mode of operation, and support
debugging there. This has tradition on Unix (atleast): many daemons
support a do-not-fork-into-background-do-not-fork-many-processes mode,
to simplify debugging.

If you find you must study the running service, use print statements.
There can be very advanced forms of print statements, like the cgitb
module for CGIs (which are also a form of embedding).

Regards,
Martin





More information about the Python-list mailing list