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