hexagon logo

Sending Signals to Python Script Inside Macro

I've got some fairly long running python scripts that I use to automate some analysis processes. They get called via a macro which then calls run_python_code. Ocassionally I'll realize I screwed up something and need to kill the script in the middle of its execution. Is there any way to send a stop/kill signal to the python process without having to exit Aview?
  • Hi Michael!
     
    Unfortunately the python processing is so tightly coupled with Adams that it cannot be killed separately.
    One way around it is to send all the information you need from the Adams database along with the call and start it as a process in a new thread. This can be done using for example by launching a TK or PyQt gui with your code in it.
    The other option is to start python and your script as its entirely own process by using for example adams system_command or pythons subprocess module.
     
    Regards
    Thomas