Re: [C++-sig] How to get output from python embedded in VC++

2017-07-22 Thread Stefan Seefeld
On 21.07.2017 23:17, Jian wrote: > Hi Imre, > > I tried to use boost.python as you advised. Build boost.python with > > But I got a error in the import.hpp as below: > import.hpp start > > namespace boost > { > namespace python >

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-22 Thread Jian
Hi Stefan, Thanks for your suggestion. First of all, I answer your question. I only want to capture the output&input from python when I call py file or import a module in C/C++ code. It works something like a debug output window does. I could only guess that Python uses something like print

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-22 Thread Jian
Hi Imre, I tried to use boost.python as you advised. Build boost.python with But I got a error in the import.hpp as below: import.hpp start namespace boost { namespace python { object BOOST_PYTHON_DECL import(str name) {

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-22 Thread Jian
Dear Imre, Thanks a lot. I'm not using boost::python but the original way from the official website. Main code to invoke py module are below 2 lines. pName = PyUnicode_DecodeFSDefault("test1"); pModule = PyImport_Import(pName); and below is my py file: import emb print("Number of arguments