On Oct 19, 2010, at 9:41 AM, Tim Roberts wrote:
> Eileen Wei wrote:
>> I am a software tester and I am exploring ways to exposing APIs of
>> Windows applications that’s developed in C++ and MFC to Python for
>> testing purpose. I just learned about COM last week and I am wondering
>> if it’s the best way to do it? I have also heard about other options
>> like SWIG (Simplified Wrapper and Interface Generator) and Boost Python.  
>> 
>> I am aware that the question might be a little off topic, but I am
>> thinking users in this mail group might have done similar exploration
>> and probably can give me some advice in terms of ease of use, maturity
>> of the technology etc.
> [...]
> For me, SWIG only seemed to made sense for interfaces that I intended to
> publish.  SWIG is quite powerful, but it has (in my opinion) a very
> steep learning curve.  You can do anything, but there are sharp edges.
> 
> I have only experimented a little bit with Boost.Python.  It does seem
> to be very cool, but you have to decide what your model is going to be. 
> Boost.Python lets you build Python extension modules easily.  If you
> want your application interface to look like a Python extension module,
> then it might make good sense.

Though not on Windows I've had good success with PyCXX [1].  It's a library 
used to wrap a python interface around C++ code.  It's not automagical like 
SWIG, but it handles the tedium associated with reference counting and error 
checking.

If you're looking for a code-free way to access your C++ code, I think ctypes, 
as Time suggests is the way to go.

-Roberto.

[1] http://cxx.sourceforge.net/

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to