call python with python extension in c
jolley84 at yahoo.com.cn
Fri Nov 24 08:41:22 CET 2006
hello all, i am a newcomer, and i bring a quesition here: how can i call python app with wxPython/other python extensions in c?
here is my code here,though not smart,it can explain myself to some extent,in addition,pls forgive me not checking the return value after each calling PyRun_SimpleString,just in the purpose of keeping the code more easier readability:
using namespace std;
cerr << " initialization fails!" << endl;
PyRun_SimpleString("from wxPython.wx import *");
PyRun_SimpleString(" def OnInit(self):");
PyRun_SimpleString(" return true");
PyRun_SimpleString("app = myApp()");
from the code above,we can see clearly i intend to build up an simple framework with its title "hello,world".but it doesnot work. mainly due to the python extension wxpython, i think.coz if i doesnot write something connected with python extension,such as wxPython.it will run normally, later my work on wxpython include ,first build the wxpython source code into some pyds and dlls, at this point, i add the pyds and dlls to the vc directory and c:\WINDOWS\system32\.unfortunately,it doesnot work.now my head aches, the whole progress is messed up. i nearly want to say goodbye to my boss.so anyway,help me,ok?
and i have searched almost anywhere,nobody i could turn to help,the feedback is little,and i am in despair.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list