Menu

#1 in dll lauch pycrust as a thread

open
nobody
None
5
2010-07-14
2010-07-14
raidsan
No

I run a win32 main program which has dll api interface, I want to write a dll to use python, and i also want to use Pycrust as a interface.
in dll, use a function: PyExecute(string)
and in main program script, i call:
PyExecute("import thread");
PyExecute("from wx.py.PyCrust import main");
PyExecute("thread.start_new_thread(main, ())");
it popup the pycrust frame ok, now in main program , i can wirte some var to python, and in pycrust i call see the var and modify or print it,
but how can i exit the frame graceful? by now, if the main program release the dll, it will cause the main program crash,
I try to call : PyExecute("thread.exit_thread()") before exit, but it don't work also.
how can i manage to do it?

Discussion


Log in to post a comment.