Search Results
Article: Stopping Code Execution In Python
… of learning Python, so I thought I would start a series of mini blog posts detailing different things that I have found useful whilst … the language. To stop code execution in Python you first need to import the sys object. After this you can then call the exit() method to stop the program running. It is the most reliable, cross-platform way of stopping code execution. Here is a simple example. import …