In my program, It sometimes encounters an error. The only way to stop the error, is to restart the program.
So how could I get python to know when there is an error?
Example - If there is an error, close down the program.
How do I do this - Thanks!
That is called exception handling. You should read about it.
The basic syntax is the following:
try: code that might give an error (aka exception) except TheExceptionExpected: thing to do if error happends