Re: how to stop python...

Discussion in 'Python' started by Tim Peters, Jul 3, 2006.

  1. Tim Peters

    Tim Peters Guest

    [bruce]
    > perl has the concept of "die". does python have anything similar. how can a
    > python app be stopped?
    >
    > the docs refer to a sys.stop.


    Python docs? Doubt it ;-)

    > but i can't find anything else... am i missing something...


    >>> import sys
    >>> print sys.exit.__doc__

    exit([status])

    Exit the interpreter by raising SystemExit(status).
    If the status is omitted or None, it defaults to zero (i.e., success).
    If the status is numeric, it will be used as the system exit status.
    If it is another kind of object, it will be printed and the system
    exit status will be one (i.e., failure).



    Of course there's nothing to stop you from catching SystemExit either
    -- it's just another exception, but one that happens to shut down the
    interpreter in the specified way if it isn't caught & handled.
     
    Tim Peters, Jul 3, 2006
    #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. Matt Theule

    Stop Debugging doesn't stop in ASP.NET

    Matt Theule, Jul 23, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    774
    Matt Theule
    Jul 24, 2003
  2. Son KwonNam
    Replies:
    11
    Views:
    2,645
    mr_organic
    Apr 9, 2004
  3. Will
    Replies:
    1
    Views:
    15,433
    Thomas Weidenfeller
    Nov 2, 2004
  4. Tom Plunket
    Replies:
    6
    Views:
    879
    Peter Hansen
    Jul 15, 2003
  5. Angus
    Replies:
    5
    Views:
    476
    Ben Bacarisse
    Jul 18, 2010
Loading...

Share This Page