[C++-sig] Calling python from c++ with tuple and dict args.

Markus Plessing plessing at ems-wuensche.com
Tue Mar 7 08:27:54 CET 2006

> Hi folks,

Hi Alex,

> [...] 
> Is there a convenient boost python way to call the python object f like 
> this from C++?

This may help. If not take a look at [1]

PyObject* PyObject_CallObject
	(PyObject *callable_object, PyObject *args)

    Return value: New reference.

Call a callable Python object callable_object, with arguments given 	
by the tuple args. If no arguments are needed, then args may be NULL.
Returns the result of the call on success, or NULL on failure. This is
the equivalent of the Python expression "apply(callable_object, args)"
or "callable_object(*args)".

> Thanks,
> Alex

Kind regards,


[1] http://docs.python.org/api/object.html#l2h-241

EMS Dr. Thomas Wuensche
Sonnenhang 3
85304 Ilmmuenster, Germany
Phone: +49-8441-490260
Fax:   +49-8441-81860
email: plessing at ems-wuensche.com
Web http://www.ems-wuensche.com (.de)

More information about the Cplusplus-sig mailing list