[C++-sig] Ask for help .

Stefan Seefeld seefeld at sympatico.ca
Mon Apr 18 05:31:56 CEST 2005


Blade wrote:
> Thanks for your answer!
> 
> Further:  how to  bind the C++ variables into the dictionary with  boost.python  not  using  Python/C API  ?
> 
> I have not found the boost.python Doc mentioned these.
> Could  you  give me some hints or  some relative resource ?
> Are there any  open source projects using python for script language  for  reference ?

You may want to look into the 'embedded.cpp' test that ships with the boost sources, i.e.
'boost/libs/python/test/embedding.cpp'. It shows how the 'main_namespace' dictionary
is constructed before being passed to a call to 'PyRun_String()'. Try some modifications,
i.e. add new variables to it before calling PyRun_String(), and then try accessing them
from inside the executed python script.

Regards,
		Stefan



More information about the Cplusplus-sig mailing list