Personal tools
You are here: Home CDAT Tips and Tricks Python Tips How to exit python.
Document Actions

How to exit python.

by Renata McCoy last modified 2007-05-08 10:18

Goal: Learn how to exit python.



Typing an end-of-file character (Control-D on Unix, Control-Z on Windows) at the primary prompt causes the interpreter to exit with a zero exit status. If that doesn't work, you can exit the interpreter by typing the following commands: 

import sys 
sys.exit()
 

Powered by Plone