Python Debugging Handbook by Zimmerman HL

Python Debugging Handbook by Zimmerman HL

Author:Zimmerman, HL [Zimmerman, HL]
Language: eng
Format: epub
Publisher: [email protected]
Published: 2020-02-05T16:00:00+00:00


Runtime

The challenge with debugging runtime errors is a line (or suite) of code runs as expected several times, and then suddenly halts with an error. As a program runs, variable values change. Another example of a RunTime error is when a program takes too long to run.

While general RunTime errors are flagged as a “RunTimeError” by the Python Interpreter, what I am referring to as “Runtime” is the overall kind of error. The actual Traceback message displayed in the Console may vary, as shown in Chapter 7 in Examples 5 and Examples 7-12.

To research a runtime error, we need to look at the values at the moment the error occurred When looking at values, you may have a critical variable that must be a certain value for your code to function. Assert statements halt the program and warn you when values are outside the parameters you require.

Another example of a Runtime error is a chunk of code that takes too long to run. In this case, the function “timeit” times program execution.

• Debug Mode

• Variable Explorer

• Interactive Mode

• Print Statements

Chapter 7 looks at these kinds of errors in Examples 1, 4, 6, 14, 15, and 17.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.