[C++-sig] python extended object to native c++ pointer

2009-08-31 Thread Mark Chandler
Im toying around with the idea to use python as an embedded scripting language for a project im working on and have got most things working. However i cant seem to be able to convert a python extended object back into a native c++ pointer. So this is my class: class CGEGameModeBase {

Re: [C++-sig] python extended object to native c++ pointer

2009-08-31 Thread Mark Chandler
File "test_c.py", line 25, in NewCharlie charlieTemp = Charlie() NameError: global name 'Charlie' is not defined Stefan Seefeld wrote: On 08/31/2009 07:51 AM, Mark Chandler wrote: Im toying around with the idea to use python as an embedded scripting language for a project im

Re: [C++-sig] python extended object to native c++ pointer

2009-08-31 Thread Mark Chandler
, Mark Chandler wrote: Stefan i spent so long on this thank you! I got another quick question, how do i define the class in the global namespace but still refer to it in functions? I want to do something like this but keep getting compile errors. The script itself looks fine (apart from some

Re: [C++-sig] python extended object to native c++ pointer

2009-09-01 Thread Mark Chandler
I worked out what was causing it. I was using a diff dict for global and local thus locals couldnt see globals and globals couldnt see locals. Thanks for your help On 31/08/2009, at 9:12 PM, Mark Chandler wrote: im using boost 1_36_0 as the latest has compile issues. im loading it via

Re: [C++-sig] Embending : Expose and Extract a dictionary object To/From C++

2009-09-03 Thread Mark Chandler
when you do the exec add the main_namespace twice object ignored = exec("print('Headline')\n print(iptc['Headline']) \n", main_namespace,main_namespace); On 03/09/2009, at 3:12 PM, Constant Dupuis wrote: Hi, I would like to expose a dictionary object instanciated in C++ to a Python code, w

Re: [C++-sig] Embending : Expose and Extract a dictionary object To/From C++

2009-09-03 Thread Mark Chandler
Can you print iptc by it self? On 03/09/2009, at 3:41 PM, Constant Dupuis wrote: Ok, thanks, Now I got a "Segmentation fault" error message when I try "print iptc['Headline']". Is the dict object directly exposable ? Or do I have to create a std::map base cl

[C++-sig] Subset of default python library

2009-09-08 Thread Mark Chandler
Is there a small subset of the default python library that i can use for our embedded instance. Since this is part of a larger app that doesnt expect to have python installed thus we are including it with the program data. How ever there is alot of stuff in there that we are not going to us