Help embedding python

Peter Hansen peter at engcorp.com
Mon Aug 25 14:38:40 EDT 2003


Zora Honey wrote:
> 
> Peter Hansen wrote:
> > Zora Honey wrote:
> >
> >>My husband and I are writing a program that does a lot of math behind
> >>the scenes (c++) with a gui front (python/Tkinter).  We've decided that
> >>we want the c++ to be the "driver", and so we want to embed the python.
> >
> >
> > It's a little unclear (to me) exactly what you're trying to do,
> > but in any case I can't imagine why you'd want to have C++ "drive"
> > the Python code (if that's what you meant by "driver", as opposed to
> > the more common sense as in "device driver") instead of the other
> > way around.
> >
> > And my inability to imagine why you want this is compounded by your
> > choice of Python and Tkinter for the front end.  It is much more
> > common to have the front end be the "driving" code, and the back end
> > be "driven", especially in CPU-intensive applications as it sounds
> > like you have here.
> >
> > -Peter
> 
> Okay.  Let's assume that the choice to embed the python was a
> well-reasoned decision.  Or assume that I want to embed some python for
> the pure joy of doing so.  Can you help?

No, sorry.  I have no particular expertise in embedding Python in a
C++ application in the way you wish.

(If I did, and I had an easy answer, I would offer it.  If, on the other hand,
I had no easy answer, and it was going to take some effort on my part,
I'd be happy to provide that effort if the person I was helping would
take a moment of his/her time to convince me that it was a well-reasoned 
decision.  If, on the other hand, the decision was based on ignorance
or merely on a frivolous desire to experience the joy of doing so at the 
cost of another's valuable time, I would probably be less inclined to help...)

(If you assume for a moment that the person who actually *can* help you
might feel somewhat the same way, you might take a moment to explain
the background rather than risk looking like you treat others' time as 
less valuable than your own.  It may not look that way to you, but I
was merely trying to help by showing you that at least one person was
puzzled by your choice.  I'm also always interested in learning, so 
I'd still be quite interested in your rationale, if you are willing to
provide it.)

Cheers,
-Peter




More information about the Python-list mailing list