Original Post
hello u all guys,i donot know whether a related-topic post is anywhere in the forum,after a search, i intend to post the thread here. i am developing a autoupgrade program,which can download client patches from the servers(>3) and execute the downloaded part as soon as the download finishes.my plan is using a bt-like program to download the patches and thread in c to control the progress of the download, my bt-like program is in python language,and furthermore,it uses BitTornado library as its assistant development library.IMO,i should use the style of embedded python in c ,as in the bt program, i use wxPython as python extension to develop bt gui.then what should i do in c to make embedded-bt-like python code run? here i put a simple wxpython-made gui without BitTornado(achive the target of showing a simple application printing "hello,world"): #include "python.h" #include <iostream>; using namespace std; int main() { Py_Initialize(); if(!Py_IsInitialized()) { cerr << "hello,world!"<< endl; return -1; } PyRun_SimpleString("from wxPython.wx import *"); PyRun_SimpleString("class myApp(wxApp):"); PyRun_SimpleString(" def OnInit(self):"); PyRun_SimpleString(" frame = wxFrame(NULL,-1,"hello,world!")"); PyRun_SimpleString(" frame.Show(true)"); PyRun_SimpleString(" self.SetTopWindow(frame)"); PyRun_SimpleString(" return true"); PyRun_SimpleString("app = myApp()"); PyRun_SimpleString("app.MainLoop()"); Py_Finalize(); return 0; } in my machine, it doesn't work.if i donot import wxPython module,then it will work cherrily.like #include <iostream>; #include "python.h" using namespace std; int main() { Py_Initialize(); if(!Py_IsInitialized()) { cerr << "hello,world!"<< endl; return -1; } PyRun_SimpleString("print 'hello,world'"); Py_Finalize(); return 0; } also how to import the whole BitTornado library to the c code? thanks if guys u can help me. regards, jolley.