简体   繁体   中英

Kill a python process

I wrote a python script but accidentally put an infinite while loop in my script.

How do I kill the process? I've tried ctrl+c but with no success.

Are there any other option to try?

I'm on Mac Os X 10.7.2 with python 2.7

尝试Ctrl+\\发送SIGQUIT。

ps a to get the PID of your process. kill -9 <pid> to send it the unblockable SIGKILL signal.

Note that I only have a Linux box in front of me to test, so the OS X commands may be slightly different.

try this.

pkill -9 python

or

ps -ef|grep python
kill -9 <pid>

or

lsof -i :port

or 
sudo kill $(sudo lsof -t -i:8000)

打开“活动”监视器,转到“进程”选项卡,然后突出显示python.exe并单击“退出”退出。

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