AW: import python module from C++ code

2011-03-06 Thread Markus Schaber
Hi, > von Arthur Mc Coy: > Still need the answer to the question: " howto embed given python file > (which contains python class and its members) into the c++ application ? " There is no straight way of embedding a Python module into a c++ application. You will have to embed the python interpre

Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Still need the answer to the question: " howto embed given python file (which contains python class and its members) into the c++ application ? " I have to pass the arguments from c++ to python and back so I need to do conversions. They are ok. Fails PyImport_Import(my_module) call saying "No modu

Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Using simple words: I have mymodule.py file and c++ application. mymodule.py file contains two classes A and B. A class is a custom data type. B class contains functions putJSON, getJSON which I want to run from within C++ code. These functions are members of class B. So I need to import mymodule.p

Re: import python module from C++ code

2011-03-04 Thread Santoso Wijaya
Extending an embedded Python is not that much different than extending Python proper. There's even this section [1] in that documentation, conveniently titled, "Extending Embedded Python." ~/santa [1] http://docs.python.org/extending/embedding.html#extending-embedded-python On Fri, Mar 4, 2011 a

Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
The problem is "how to write python module under SWIG for C++ application" Nor SWIG documentation neither embeding python documentation does not answer to this. If you can help, please, share your idea. Arthur -- http://mail.python.org/mailman/listinfo/python-list

Re: import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Yes, I did. Here the link http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module It does not cover .py file embeding. So it is not my case. On Fri, Mar 4, 2011 at 7:03 PM, Santoso Wijaya wrote: > Have you read the doc [1] on extending/embedding Python? > > ~/sa

Re: import python module from C++ code

2011-03-04 Thread Santoso Wijaya
Have you read the doc [1] on extending/embedding Python? ~/santa [1] http://docs.python.org/extending/ On Fri, Mar 4, 2011 at 8:27 AM, Arthur Mc Coy <1984docmc...@gmail.com>wrote: > Hi all, > > > I have a C++ application. I have a .cpp file which is not a main > program, but a class where I wan

import python module from C++ code

2011-03-04 Thread Arthur Mc Coy
Hi all, I have a C++ application. I have a .cpp file which is not a main program, but a class where I want to call python script (doSomething.py file). I'm using embed python like in a tutorial here: http://www.codeproject.com/KB/cpp/embedpython_1.aspx But the tutorial is bad. It does not expla