Jump to content

DaveLaneCA

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by DaveLaneCA

  1. I am adding the capability to run python code to my existing astrophysics application so I can leverage the incredible python libraries available. When I run simple python scripts, all is fine. Whenever I run anything complicated that imports other code (example 'numpy'), the script hangs. The same script runs fine using any of the demo apps (demo01, for example). I have diagnosed the problem to being thread- related. I run all my existing (native delphi) calculations in a TThread so that the program's user interface is not blocked (no VCL calls are made from the thread). When I run the complicated script from my existing TThread, it hangs (can be duplicated by just an "import numpy as np" line). If I run the same code from the application's main thread, it works fine. Any idea why this would be OR how to run a python script in a thread OR how to run python code in a way that does not block the primary thread. --- Dave
  2. I have looked at them, but did not think the additional complexity would be needed if I only intended one python thread within the application. If you say that a single (threaded) python script still needs to use TPythonThread, I'll look give it ago.
  3. Yes David - I read that. I am not trying to run more than one python thread in an app (instance of pythonxx.dll). I understand that Indy, in his example, would mean multiple python threads.
×