Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread Alan Baljeu
My question probably derives from ignorance of the Python way. I kind of assumed people would advocate defining classes and methods, and then calling those methods. You apparently see things otherwise. One thing I'm considering is to make one layer of abstraction, and define a Python function

Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread Stefan Seefeld
Alan Baljeu wrote: My question probably derives from ignorance of the Python way. I kind of assumed people would advocate defining classes and methods, and then calling those methods. You apparently see things otherwise. Not really. I just see it as an orthogonal problem to the question you

Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread Alan Baljeu
>It seems your question is all about the boundary / interface between the (C++) >application and the script that gets invoked: What should the content of the >dictionary be, and what is the script expected to do with it ? >In the most trivial case such a script could simply store named values >(

Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread Stefan Seefeld
Alan Baljeu wrote: To solve this, I intend to write as much Python as possible, to drive C++ objects, so I won't have to recompile, or restart my environment. (Previous use of python had a slightly different goal: use Python minimally for a dynamic modeling problem) So Python code will consist

Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread Alan Baljeu
>This sounds perfectly reasonable to me, FWIW. >An interesting question then is how you embed your interactive Python shell >into the application's main event loop. But that's mainly an implementation >detail. :-) > >Regards, > Stefan Well, rendering is on a separate thread, so no issue the

Re: [C++-sig] PyEval_EvalCode

2008-11-12 Thread David Abrahams
on Wed Nov 12 2008, Alan Baljeu wrote: >>This sounds perfectly reasonable to me, FWIW. >>An interesting question then is how you embed your interactive Python shell >>into the > application's main event loop. But that's mainly an implementation detail. :-) >> >>Regards, > > Stefan > > Well

[C++-sig] c++ object deleted

2008-11-12 Thread Renato Araujo
Hi all, Is possible in boost::python create a exception when the c++ object is deleted internal, and you try use the python object. Because here I got a core when I try do this. BR -- Renato Araujo Oliveira Filho ___ Cplusplus-sig mailing list Cpluspl

Re: [C++-sig] c++ object deleted

2008-11-12 Thread Stefan Seefeld
Renato Araujo wrote: Hi all, Is possible in boost::python create a exception when the c++ object is deleted internal, and you try use the python object. Because here I got a core when I try do this. I'm not sure whether it's technically possible, but I do believe this is a bad idea: Except

Re: [C++-sig] Manage new object return policy (was Re: new to python; old to C++)

2008-11-12 Thread Paul Melis
David Abrahams wrote: > on Mon Nov 10 2008, Paul Melis wrote: > > >> The FAQ entry on this doesn't really help, so perhaps I'm not using the >> return policy >> correctly or missing something else. The full test code (which is actually >> quite >> small) is attached. >> > > Please reduce

Re: [C++-sig] Manage new object return policy (was Re: new to python; old to C++)

2008-11-12 Thread David Abrahams
on Wed Nov 12 2008, Paul Melis wrote: > David Abrahams wrote: >> on Mon Nov 10 2008, Paul Melis wrote: >> >> >>> The FAQ entry on this doesn't really help, so perhaps I'm not using the >>> return > policy >>> correctly or missing something else. The full test code (which is actually >>> qu

Re: [C++-sig] c++ object deleted

2008-11-12 Thread Renato Araujo
The main problem here is my parent control. My object life is controlled by the parent life time: somethin like that: struct object { object(object *parent) { parent.add_child(this); } ~object() } On Wed, Nov 12, 2008 at 2:14 PM, Stefan Seefeld <[EMAIL PROTECTED]> wrote: >