Calling Python from C++

Someone where at there.com
Thu Oct 19 12:22:54 EDT 2000


Thanks Lyle, your advice "start small and work your way up" is my plan too.

I'm still hoping that someone else has already "invented the wheel" so to
speak,
and can point me to an example of where they are reading in a large list of
C++
objects (or even C data structures) and then processing using that imported
data.  If this has been done before, and I can look at an implementation,
then it
may save me making the same mistakes that may have already been made.

Thanks for your suggestion about SWIG, I'll check it out.

Eric


Lyle Johnson <ljohnson at resgen.com> wrote in message
news:sutuukl1u1rk51 at corp.supernews.com...
> Eric,
>
> I'd advise you to start small and work your way up to the eventual goal
you
> described -- not that it will be very difficult to get to that point. Have
> you at least succeeded in getting the simple embedding example described
in
> the Python documentation to work? If so, you're a lot of the way there.
> Depending on the number of classes and functions that you planning to
expose
> to Python, you might also want to look at SWIG
(http://swig.sourceforge.net)
> to automatically generate a lot of the wrapper code that you'd normally
need
> to write by hand. If you're only going to make a few new functions
available
> to Python it's probably not worth the trouble of downloading, installing
and
> learning to use SWIG.
>
> Hope this helps,
>
> Lyle
>
> "Someone" <where at there.com> wrote in message
> news:8smo5k$1s at dispatch.concentric.net...
> > I'm looking for more information and examples of calling (or embedding)
> > Python from C++ in a Win98 app.
> >
> > I have been to the www.python.org site, read the tutorials, read the
> > Extension/Embedding doc, read the Python/C API doc, read the FAQ and
> looked
> > over the referenced example in ../demo/embed.
> >
> > Is there more about embedding somewhere else?  I'm especially looking
for
> > examples of how others made large lists of C++ objects availble to be
read
> > from the embedded Python routines.
> >
> > Thanks in advance for any suggestions.
> >
> > Eric






More information about the Python-list mailing list