Re: How do I use python object in C++

2008-09-23 Thread lixinyi . 23
On 9月24日, 午後1:15, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 23, 11:06 pm, "Aaron \"Castironpi\" Brady" > > > > <[EMAIL PROTECTED]> wrote: > > On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > > > > If the PyObject is a PyList, and all list items are strings, > > > say a=['aaa','

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 11:06 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > > > > > If the PyObject is a PyList, and all list items are strings, > > say a=['aaa','bbb','ccc'] > > > How can I have a > > myArray[0] = "aaa" > > myArray[1] = "bbb" > > m

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 9:30 pm, [EMAIL PROTECTED] wrote: > If the PyObject is a PyList, and all list items are strings, > say a=['aaa','bbb','ccc'] > > How can I have a > myArray[0] = "aaa" > myArray[1] = "bbb" > myArray[2] = "ccc" > in C++? > > Do I have to > use PyModule_GetDict() to get the dict first? > wh

Re: How do I use python object in C++

2008-09-23 Thread lixinyi . 23
If the PyObject is a PyList, and all list items are strings, say a=['aaa','bbb','ccc'] How can I have a myArray[0] = "aaa" myArray[1] = "bbb" myArray[2] = "ccc" in C++? Do I have to use PyModule_GetDict() to get the dict first? what about the next? > > What do you know about the contents of 'ar

Re: How do I use python object in C++

2008-09-23 Thread Aaron "Castironpi" Brady
On Sep 23, 7:50 pm, [EMAIL PROTECTED] wrote: > for example I have the following code: > > #include > > void exec_pythoncode( int arg, char**argv ) > { >     Py_Initialize(); >     Py_Main(argc,argv); >     Py_Finalize(); > > } > > What I would like to know is how can I get the variables I want > a

How do I use python object in C++

2008-09-23 Thread lixinyi . 23
for example I have the following code: #include void exec_pythoncode( int arg, char**argv ) { Py_Initialize(); Py_Main(argc,argv); Py_Finalize(); } What I would like to know is how can I get the variables I want after Py_Main(argc,argv) say I have a=[1,2,'Hello World',0.1234] in th