Re: [C++-sig] Cplusplus-sig Digest, Vol 15, Issue 3
when i: "fun(**kwargs)" I get following runtime error: TypeError: No to_python (by-value) converter found for C++ type: boost::python::detail::kwds_proxy thx again meiko
Message: 1 Date: Thu, 3 Dec 2009 13:11:41 +0100 From: meiko rachimow <rachimow@googlemail.com> To: cplusplus-sig@python.org Subject: [C++-sig] boost.python: call python function with kwargs from c++ Message-ID: <6a5b23630912030411m5be57968t9d8a2a7baf43fb9c@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1"
Hi
How can I call a function defined in a python module from c++, if I have to give **kwargs parameter...
example.py:
def hello(**kwargs): for key, value in kwargs.items(): print key, " - ", value
c++: using namespace boost::python;
object fun = import("example").attr("hello") fun()
int number = 42 std::wstring name = "M?hre"
dict kwargs; kwargs["Number"] = number; kwargs["Name"] = name;
fun(...) ???
What should i do ?
Meiko
participants (1)
-
meiko rachimow