CISC 121 Lecture 15: Execution tracing, choosing how to do execution tracing, pausing execution, idle's debugging tools,
CISC 121 verified notes
15/38View all
Document Summary
Execution tracing: tracking the course of a running program"s execution computers can execute code faster than we can think about it. Python 3 can initialize a list of a million elements in just over a thenth of a second. If we want to trace a program during execution, we have to do one of the following. Get the program to report some of what it has done. This canbe achieved by temporarily inserting print() statements to show the values of certain variables at specific points in the code. This is a ueseful technique that is adaptable for use in many languages, requiring no particular software tools. Get the program to temporarily suspend execution and display the values of some variables at a point. An easy technique to stop a running python 3 program while allowing possibility to continue is to insert a keyboard input statement def my_function (param1, param2): print(locals()) input( press enter to continue")