Microsoft Visual C++ and pyton

mike mike at lookdirect.com.au
Mon Jan 31 17:42:11 EST 2005


Thanks Chris..
I was also advised to build the python core (pythoncore.vcproj) with my
C++ program. By that way I would not have to load the python core
anymore during runtime. Is this a good approach?
I am currently using VC++ 7 and python 2.4.
- mike

Christopher De Vries wrote:
> On Sun, Jan 30, 2005 at 03:12:06PM -0800, mike wrote:
> > I am new with python.  Is it possible to have an MFC application
and
> > develop some module using python? what are the steps in doing this?
can
> > anybody give me a url or some documentation for this.. thanks..
>
> It is possible to embed python in a C or C++ application, enabling
you to call
> python functions from C. I would recommend reading "Extending and
Embedding the
> Python Interpreter" at http://docs.python.org/ext/ext.html for more
> information. If you are currently using Visual C++ 6.0, either stick
with
> Python 2.3 or read this:
http://www.vrplumber.com/programming/mstoolkit/ to
> learn how to build extensions for python 2.4 with the free VC++
toolkit
> compiler. If you are already using version 7 of the Microsoft C++
compiler then
> you should have no problems with Python 2.4.
>
> I usually do not embed the interpreter, but I have written some
extension
> modules... well, I should say I have used SWIG (http://www.swig.org/)
to create
> wrappers around some C libraries. For information (read: rants) on
extending
> versus embedding see
http://twistedmatrix.com/users/glyph/rant/extendit.html
> and http://c2.com/cgi/wiki?EmbedVsExtend .
>
> You can also use win32 python extensions to make your module
available through
> COM, but I don't know anything about that.
> 
> Chris




More information about the Python-list mailing list