How can I return a non-zero status result from a python script?

Taskinoor Hasan taskinoor.hasan at csebuet.org
Tue Dec 16 01:56:16 EST 2008


sys.exit() raise SystemExit() exception which could be caught and if not
caught, terminate only the current thread. If your program is multi-threaded
and you want to terminate the process, i.e all threads, immediately then use
os._exit(1)

On Tue, Dec 16, 2008 at 7:52 AM, Miki <miki.tebeka at gmail.com> wrote:

> Hello,
>
> > How can I return a non-zero status result from the script? Just do a
> > return 1? at the end?
> raise SystemExit(1)
>
> HTH,
> --
> Miki <miki.tebeka at gmail.com>
> http://pythonwise.blogspot.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081216/bd24b069/attachment-0001.html>


More information about the Python-list mailing list