Merging modern software development with electrons and metal
Random header image... Refresh for more!

Debugging Python COM Servers With Winpdb

I have a substantial amount of Python code that needs to talk to the Microsoft world using COM (both as a client and as a server).  Parts of the Python COM server are pretty slick, such as dynamic dispatch (I use dynamic dispatch to automatically make Python methods whose name match a specific pattern available via COM).

However, it’s much harder to debug a Python COM server.  In VB6, I can start an out of process COM server from the IDE, wait for clients to connect, and easily use all the VB debugging goodness….

But I can’t do that in Python.  Most of the time I’ve managed OK by either testing the code via a different non-COM interface or using logging.  However, I did find a better solution for when I just have to see what’s going on: Winpdb.

Winpdb is a cross-platform (Windows, Linux, and possibly more – not just Windows) remote debugger with a graphical interface.  I installed it without problems (basically, installed wxPython then Winpdb), and used the embedded debugging feature.  Just remember to remove the debugging code when you’re done.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment