Skip to Main Content
Python Programming On Win32
book

Python Programming On Win32

by Andy Robinson, Mark Hammond
January 2000
Intermediate to advanced content levelIntermediate to advanced
672 pages
21h 46m
English
O'Reilly Media, Inc.
Content preview from Python Programming On Win32

The Debugger

PythonWin also has a built-in Python debugger to help you develop your scripts. The PythonWin debugger includes all the features you expect in debuggers, including:

  • Breakpoints that can be set at any location. Optionally, these breakpoints may have a condition that must evaluate to true before the breakpoint stops.

  • A watch window allowing easy tracking of changes to key variables.

  • Commands allowing you to step into, over, or out of functions.

If you are familiar with other Windows IDE debugging environments (such as Visual C++, Visual Basic, or Delphi) you should find the debugger easy to work with.

For a language as flexible as Python, there is one huge limitation in the debugger that is worth noting. It isn’t possible to modify the code while it’s being debugged. If you spot a bug while debugging, code changes you make aren’t applied until you reload the module. Further, any source-code changes are likely to disrupt the debugging session, as the debugger will still be stepping though the original line positions even though they are likely to have changed.

The simplest way to use the debugger is to run scripts using the same technique described earlier, but this time select one of the debugging options. The Run Script dialog provides the following debugging options:

No debugging

This means that the script runs normally without any debugging; it doesn’t stop at breakpoints.

Step through in the debugger

Steps through each line in the debugger. Selecting this option invokes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Python Programming - Second Edition

Advanced Python Programming - Second Edition

Quan Nguyen

Publisher Resources

ISBN: 1565926218Supplemental ContentErrata Page