Newbie: How to do an exit ?
Jere Kahanpaa
jkahanpa at pcu.helsinki.fi.invalid
Fri Apr 7 08:36:43 EDT 2000
Pascal Fremaux <pf at sxb.bsf.alcatel.fr> wrote:
: How to exit from a program ?
: I don't find a command such as exit(0) in C
The 'sys' module has everything you need
Try
import sys
sys.exit()
or
from sys import exit
exit()
BTW: This is explained in the tutorial in chapter 2.1 (at least in version 1.5.2). Unfortunately
the standard Python tutorial is not very user-friendly: it doesn't have any index or searching
tools. Personally used to do a lot or grepping around until I found the clues I needed.
Happy hacking
Jere Kahanpää
More information about the Python-list
mailing list