If you can ssh into the device you can find the pid of the running script:
ps aux | grep python - will list all python scripts, you can replace python with the name of your script.
Then use kill #### to stop the script.
Alternatively, restart the device and make sure that script doesn't run automatically.