简体   繁体   中英

stop python script from terminal

I have an android app and a raspberry pi. I create connections via ssh between them. I send commands from my android app to the rpi and these commands typically run python scripts.

My plan is the following: As long as my phone is in a specified radius regarding to the gps coordinates, I'd like to run python scripts. If I1m out of that radius, I'd like to stop that python script. How can I stop a running python script from terminal/cmd?

Thanks

You can stop EVERY python script by wunning the command

sudo killall python

in the terminal. Killing individual scripts will require the PID of the python script you wish to stop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM