-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access violation: Open Tk GUI and running a python function without closing the GUI #474
Comments
When your run the tkinter script the ExecStrings does not exit until you close the tkinter window. The tkinter mainloop somehow keeps the Delphi message loop alive, and when you try to execute py1, this is effectively a recursive call to ExecStrings and does not work. To make the above work, you need to run all scripts in threads using for instance ThreadPythonExec. See https://github.com/pyscripter/python4delphi/wiki/PythonThreads for more details. |
Hi! My use case is to run some I see that in PyScripter you register PyModules on the Internal Interpreter, and I was able to register and run my module on the Internal Interpreter in PyScripter. I see that PyScripter doesn't run the Internal Interpreter code it a thread. I see that if I use remote interpreter then it runs the Python code in a thread (and doesn't go into a deadlock) but I couldn't figure out how to run another function at the same time from the PyScripter IDE (as the run button is grayed out until I close the Thanks! |
Did you follow the instructions?
|
Oh, Thanks, I misread that section before. |
Hi,
Is it possible to open a Python GUI (created with
tk
for instance) and then run a python function without closing the tk window?I've created a project to demonstrate the issue here:
https://github.com/idanmiara/pyscripter_test
in order to demonstrate the issue please run the project then click the buttons in the following order:
init
,py load
,py1
- this worksinit
,py load
,py5
, close the tk window,py1
- this worksinit
,py load
,py5
,py1
- this would causeAccess violation
.(there are some other buttons there which are not related to this question)
Thanks!
The text was updated successfully, but these errors were encountered: