Find the process id (PID) of the script and issue a kill -9 PID
to kill the process unless it's running as your forground process at the terminal in which case you can Contrl-C to kill it.
Find the PID with this command:
ps -elf | grep python
It lists all the python processes, pick out the right one and note its PID. Then
kill -9 <whatever_the_PID_is>
will kill the process. You may get a message about having terminated a process at this stage.
Alternatively, you can use the top
command to find the python process. Simply enter k
(for kill) and the top
program will prompt you for the PID of the process to kill. Sometimes it's difficult to see all processes you are interested in with top
since they may scroll off the screen, I think the ps
approach is easier/better.