This may be possible depending on what kind of digi product you are running:
X2, X4, X8, CC3G - Realistically, it’s not possible to do this. Theoretically it’s possible to use digicli to call the ‘kill’ command. You might be able to guess the number of the python app
X2e - you should be able to call the ‘ps’ command to determine the process number of the script. Then call the ‘kill’ command to terminate it.