Python in a VS 6.0 environment?

Mark Hammond mhammond at
Thu Feb 6 23:29:11 CET 2003

Brandon Van Every wrote:
> Can anyone who prefers a MS Visual Studio 6.0 working environment comment on
> the ease / difficulty of integrating Python with your C++ code?  What are
> the gotchas?  I'd like to know what tools have made the experience the least
> painful for you.
> Please, no responses like "why not switch to Emacs?" or whatever.  At
> present, I'm not interested, I don't have the time.  The question is the
> question.

I tend to use MSVC for editing C++ sources, but generally use Pythonwin 
or similar as a Python editor.  Further, there is no facility to 
integrate debuggers - ie, you can not step from your C++ code into your 
Python code and back using the same debugger.

However, that said, the actual development and debugging process is very 
good.  With a little time, it is very easy to see from the C++ debugger 
exactly where your Python code is executing.  You can call 
"DebugBreak()" from your Python script to control exactly when you want 
to fall back to the MSVC debugger.  Conditional breakpoints can be 
effectively used to determine some reference counting bugs in your 
extension.  Switching between "debug" and "release" builds of Python and 
your extension is quite trivial when you do need to dig down at this level.

C++ integration is fine, but still at C.  The core Python API has no 
"base class" you can use which abstracts from the function pointers used 
by Python to virtual functions preferred by C++.  There is a C++ wrapper 
for Python, but I have never used it - hand-rolling your own really is 
pretty easy.  Note that MFC has been wrapped (by me), along with decent 
COM bindings (basically interfacing to C++ - also by me <wink>), and 
many other people have wrapped large C++ frameworks in Python without 

Hope this helps,


More information about the Python-list mailing list