Python @ DjangoSpin

Python: Terminating your program

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon
Reading Time: 1 minutes

Terminating your program in Python

Terminating your program in Python

In order to exit from a Python script/Interactive Interpreter Session/Command Prompt Session, any of the following functions can be used: exit(), quit(), sys.exit(). While calling these functions, you can provide an exit_code as the first argument. These exit codes can be used in bash scripting, where the special variable $? returns the last exit status.


See also:

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon

Leave a Reply