there is a python gui script,whose GUI part is in wxPython. and now i want it to be used in c, so what shall i do,if i install wxPython from exe or source code?
furthermore if i use the latter option, then how shall i place the build products? like vc_dll(contains the wxWidgets build product),wx(contain the wxPython build product,mainly .pyds and .pdbs).and also wxPythnon directory to make the script function normally?
#include "python.h"
#include "wx/wxPython/wxPython.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;
}
thanks if any feedbacks.
regards,
jolley
furthermore if i use the latter option, then how shall i place the build products? like vc_dll(contains the wxWidgets build product),wx(contain the wxPython build product,mainly .pyds and .pdbs).and also wxPythnon directory to make the script function normally?
#include "python.h"
#include "wx/wxPython/wxPython.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;
}
thanks if any feedbacks.
regards,
jolley