Re: [C++-sig] looking up functions

2008-11-13 Thread Renato Araujo
you can use: python::object callback = obj.attr["function_name"]; callback(); On Thu, Nov 13, 2008 at 11:40 AM, Alan Baljeu <[EMAIL PROTECTED]> wrote: > I'm reading the Python extension tutorial, and I cannot believe the embedding > section. It tells me the only way to call a python functio

Re: [C++-sig] looking up functions

2008-11-13 Thread David Abrahams
on Thu Nov 13 2008, Stefan Seefeld wrote: > Alan Baljeu wrote: >> >> As best I could figure, I needed to write Python code, execute a script >> file, get >> that code to call a C function that I register, in order to have that >> function. At >> least the tutorial implied that was the way. >

Re: [C++-sig] looking up functions

2008-11-13 Thread Stefan Seefeld
Alan Baljeu wrote: I misspoke. I want a Python function. I was confused by the lack of any PyModule_GetFunction or anything resembling that in the API. This is because there is nothing special about functions, as far as retrieving them from a module('s namespace) is concerned. You just

Re: [C++-sig] looking up functions

2008-11-13 Thread Alan Baljeu
I cryptically wrote: > As best I could figure, I needed to write Python code, execute a script file, > get that code to call a C function that I register, in order to have that > function. At least the tutorial implied that was the way. Which made Stefan respond: >I'm confused. In your last ma

Re: [C++-sig] looking up functions

2008-11-13 Thread Stefan Seefeld
Alan Baljeu wrote: As best I could figure, I needed to write Python code, execute a script file, get that code to call a C function that I register, in order to have that function. At least the tutorial implied that was the way. I'm confused. In your last mail you asked for how to get hold

Re: [C++-sig] looking up functions

2008-11-13 Thread Alan Baljeu
Hans Meine wrote: >I don't see the problem. AFAICS, "ask for a function by name" is "ask python >[i.e. callout to python] for a function [which is an object that I can safe >when I want to call it repeatedly] by name". Which part could be simpler? As best I could figure, I needed to write Pyth

Re: [C++-sig] looking up functions

2008-11-13 Thread Hans Meine
On Thursday 13 November 2008 15:40:31 Alan Baljeu wrote: > I'm reading the Python extension tutorial, and I cannot believe the > embedding section. It tells me the only way to call a python function is > to callout to python to pass back a function object which I then save so I > can call it when

Re: [C++-sig] looking up functions

2008-11-13 Thread Stefan Seefeld
Alan Baljeu wrote: I'm reading the Python extension tutorial, and I cannot believe the embedding section. It tells me the only way to call a python function is to callout to python to pass back a function object which I then save so I can call it when I need to. This seems ridiculous. Surel

Re: [C++-sig] looking up functions

2008-11-13 Thread Gustavo Carneiro
2008/11/13 Alan Baljeu <[EMAIL PROTECTED]> > I'm reading the Python extension tutorial, and I cannot believe the > embedding section. It tells me the only way to call a python function is to > callout to python to pass back a function object which I then save so I can > call it when I need to. T

[C++-sig] looking up functions

2008-11-13 Thread Alan Baljeu
I'm reading the Python extension tutorial, and I cannot believe the embedding section. It tells me the only way to call a python function is to callout to python to pass back a function object which I then save so I can call it when I need to. This seems ridiculous. Surely there is a way to o