TECHIES WORLD

For Techs.... Techniques.... Technologies....

CpanelLinuxPython

How to exit from Python script

Sometimes we need to exit from Python script in certain conditions. We can use the sys utility to accomplish this requirement.

import sys
sys.exit()

The script will be terminated at this point.

Leave a Reply