Re: How to kill Python interpreter from the command line?

Discussion in 'Python' started by Diez B. Roggisch, May 8, 2008.

  1. wrote:

    > Hello.
    >
    > I am running Fedora Linux and KDE, using the Konsole command line.
    >
    > When coding Python, I regularly make a bug causing my program to not
    > terminate. But how do I kill the non-terminating Python interpreter
    > without killing the entire Konsole?
    >
    > The default way of killing the current process on the command line is
    > Ctrl+C, but that doesn't work with Python. Neither do the "terminate
    > task", "suspend task" or "interrupt task" commands (available from
    > right-click in Konsole).
    >
    > So, can someone please help? How do I kill Python without having to
    > restart Konsole?



    put it into the background using C-z, and then look for it's pid using ps.
    Issue a kill -9 towards it.

    For example, I just in the moment use this commandline to do so (for a
    certain script named frontend_cherrypy.py:

    ps ux | grep frontend | kill -9 `cut -c 5-15`

    Diez
     
    Diez B. Roggisch, May 8, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan

    Command line interpreter

    Ryan, Oct 19, 2004, in forum: C++
    Replies:
    7
    Views:
    5,759
    Thomas Maier-Komor
    Oct 20, 2004
  2. Replies:
    4
    Views:
    1,724
    Terry Hancock
    Apr 23, 2005
  3. Replies:
    2
    Views:
    436
    Dennis Lee Bieber
    Aug 20, 2006
  4. Replies:
    3
    Views:
    769
    Ziga Seilnacht
    Jan 3, 2007
  5. Jean-Paul Calderone
    Replies:
    3
    Views:
    1,680
    Thomas Bellman
    May 10, 2008
Loading...

Share This Page