Hello every one
Did anybody tried to embed pyprocessing (http://
pyprocessing.be rlios.de/) in a c app? im using python 2.4 and
pyprocessing 0.52 under winxp sp2. but it doesnt seem to work. I added
a print statement in Process.start() method after
'_current_proce ss._children.ad d(self)' command in process.py file line
97 and it prints as its in a kind of loop!
here is the sample program:
#define WIN32_LEAN_AND_ MEAN
#include<window s.h>
#include "python.h"
int main(int argc, char **argv)
{
Py_Initialize() ;
PyRun_SimpleStr ing("import sys\n"
"sys.argv=['']\n" //a cheat to make processing go on!
"from processing import Process,Queue,f reezeSupport\n"
"def f(q):\n"
"\timport wx\n"
"\tfrom wx.py import crust\n"
"\tapp = wx.PySimpleApp( redirect=False) \n"
"\tframe = crust.CrustFram e()\n"
"\tframe.Show() \n"
"\tapp.MainLoop ()\n"
"q=Queue()\ n"
"if __name__ == '__main__':\n"
"\tfreezeSuppor t()\n"
"\tq=Queue( )\n"
"\tp = Process(target= f, args=(q,))\n"
"\tp.start()\n" );
Py_Finalize();
}
Best Regards,
Mani
Did anybody tried to embed pyprocessing (http://
pyprocessing.be rlios.de/) in a c app? im using python 2.4 and
pyprocessing 0.52 under winxp sp2. but it doesnt seem to work. I added
a print statement in Process.start() method after
'_current_proce ss._children.ad d(self)' command in process.py file line
97 and it prints as its in a kind of loop!
here is the sample program:
#define WIN32_LEAN_AND_ MEAN
#include<window s.h>
#include "python.h"
int main(int argc, char **argv)
{
Py_Initialize() ;
PyRun_SimpleStr ing("import sys\n"
"sys.argv=['']\n" //a cheat to make processing go on!
"from processing import Process,Queue,f reezeSupport\n"
"def f(q):\n"
"\timport wx\n"
"\tfrom wx.py import crust\n"
"\tapp = wx.PySimpleApp( redirect=False) \n"
"\tframe = crust.CrustFram e()\n"
"\tframe.Show() \n"
"\tapp.MainLoop ()\n"
"q=Queue()\ n"
"if __name__ == '__main__':\n"
"\tfreezeSuppor t()\n"
"\tq=Queue( )\n"
"\tp = Process(target= f, args=(q,))\n"
"\tp.start()\n" );
Py_Finalize();
}
Best Regards,
Mani