Home » Support » Index of All Documentation » Introduction for New Users » Wing IDE Tutorial » Tutorial: Debugging »
1.6.2. Tutorial: Command Line Power Debugging
Wing IDE Professional's Debug Probe provides a powerful way to find and fix complex bugs. This works much like the Python Shell but lets you interact directly with your paused debug program, in the context of the current stack frame:
Try it out from the point of exception reached earlier by typing this:
news[0][0]
This will print the date of the first news item:

Next, try this:
news[0][0] = '2004-06-15'
This is one way to change program state while debugging, which can sometimes be useful when testing out code that will go into a bug fix. Try this now:
PrintAsText(news)
This executes the function call and prints its output to the Debug Probe. Note that the Debug I/O tool is not used for input or output whenever it results from commands typed in the Debug Probe. All Debug I/O is temporarily redirected here.
Note that Wing offers auto-completion as you type and shows call signature and documentation information in the Source Assistant.
Here is another possibility. Copy/paste or drag and drop this block of code to the Debug Probe:
def PrintAsHTML(news):
for date, event, url in news:
print '<p><i>%s</i> <a href="%s">%s</a></p>' % (date, url, event)
This actually replaces the buggy definition of PrintAsHTML that's in the example1.py source file, so that you can now execute it without errors as follows:
PrintAsHTML(news)
This can be useful in designing bug fixes when the fix depends on lots of program state, or happens in a context that is hard or time-consuming to reproduce in the debugger: Quick interactive trial and error replaces multiple edit/debug cycles.
| « 1.6.1. Tutorial: Debug Process Exception Reporting | Table of Contents | 1.6.3. Tutorial: Watching Debug Data » |
