[python-win32] A question about COM in general
roberto.c.aguilar at gmail.com
Tue Oct 19 19:39:57 CEST 2010
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 . 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.
More information about the python-win32