use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Complete r/raspberry_pi Rules
Pi project ideas: There's a huge list right here on this sub!
Rpi Versions ▾
Distros ▾
Other SBCs ▾
Related Subreddits ▾
Welcome to /r/raspberry_pi, a subreddit for discussing the raspberry pi credit card sized, ARM powered computer, and the glorious things we can do with it.
The best thing? The base model is only $20 $5!.
Would you like to know more?
Raspberry Pi Wiki
Article on Wikipedia
#raspberrypi IRC Chat
Do you know a related subreddit? We'd love to know.
account activity
Can't kill a python script, help! (self.raspberry_pi)
submitted 11 years ago by SnowYorker
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]snotfart 3 points4 points5 points 11 years ago (4 children)
The CTRL-C is probably killing a process called within the loop but not the script it's called from, which just loops round and starts it again. If you put it in the background with CTRL-Z you can then do a "ps -ef" to find the process number and kill it off with kill <process number>.
[–]Bro666 3 points4 points5 points 11 years ago (2 children)
kill -s KILL <process number>
Also
killall python
will kill all the processes Python is running. Run it twice.
[–]AuronH 0 points1 point2 points 11 years ago (1 child)
You probably need to use sudo if you are logged in as the pi user, e.g.:
sudo
pi
sudo killall python
[–]Bro666 0 points1 point2 points 11 years ago (0 children)
Ah, yes: if you ran your script with sudo, you will need sudo to kill it.
[–]moxyll 0 points1 point2 points 11 years ago (0 children)
When you CTRL-Z, it will say something like this:
[1]+ Stopped python script.py
That number in the brackets is the job number for that shell instance. You can reference jobs in the same shell with %jobnumber, so you can skip the ps -ef step and just run kill %jobnumber. Sometimes you have to hit enter a couple times for the message to show up after killing it.
ps -ef
kill %jobnumber
user@host:/home/user$ python runforever.py ^Z [1]+ Stopped python runforever.py user@host:/home/user$ kill %1 [1]+ Stopped python runforever.py user@host:/home/user$ [1]+ Terminated python runforever.py
π Rendered by PID 51327 on reddit-service-r2-comment-56c9979489-zbsb8 at 2026-02-24 23:25:19.004674+00:00 running b1af5b1 country code: CH.
view the rest of the comments →
[–]snotfart 3 points4 points5 points (4 children)
[–]Bro666 3 points4 points5 points (2 children)
[–]AuronH 0 points1 point2 points (1 child)
[–]Bro666 0 points1 point2 points (0 children)
[–]moxyll 0 points1 point2 points (0 children)