Can python be used to debug other languages?

Robert k.robert at gmx.de
Wed Oct 2 18:09:45 CEST 2002


> I am doing research in school and I was just wondering if python can
> be used to debug other languages such as C++ and java. IF it does, can
> anybody give me an info how?
> I am doing research in school and I was just wondering if python can
> be used to debug other languages such as C++ and java. IF it does, can
> anybody give me an info how?

In deed, when I came about python years ago, I had C++ code. Immediatly I
wrapped as much C++ code as possible and mostly automatically with SWIG
(www.swig.org ?). Then I found myself *debugging* C++ with Python by calling
the C++ code (funcs + objects) interactively - having the python and C
debugger in parallel. This way debugging was not anymore limited to the
*single* execution path a C program typically has, but became interactive
evolving of code. You could easily test objects and functions without having
all the framework set up, or walk through the C++ structure just in the
moment when a problem occures ...

And of course pythons 'unittest' or short test scripts are much more handy
than a C++ test framework.

After a while you may find that most code (=control part!)
should be written in Python and C/C++ should be used for those 5%, where
speed, memory and machine context is important. If you want apps appearing
as binary, EXE, DLL/.so, .. postprocessing with py2exe and other tricks is
often easy.

Think JAVA is shit at all for a pythoneer. But I saw a guy proudly and
interactively walking through JAVA structure (debugging?) by simply loading
the Jython interpreter. Maybe its a good option before asking the
JAVA-question at all :-)

Robert








More information about the Python-list mailing list