Search code examples
pythonpython-idle

How do I set a breakpoint in a module other than the one I am running in Python IDLE?


If I edit two modules, eggs and ham, and module eggs imports ham, how do I run module eggs such that IDLE stops at breakpoints set in ham? So far, I have only been able to get IDLE to recognize breakpoints set in the module actually being run, not those being imported.


Solution

    1. start IDLE
    2. open eggs, open ham
    3. set desired breakpoints in both files
    4. go to IDLE's shell, select Debug=>Debugger
    5. go back to eggs and to run.

    You should stop at break points in each file. (It works, I just tested it.)