0

How do I get my python code to compile one line at a time so I can see exactly how the code works. If anyone knows how to do this with Wing IDE that would also be helpful. Thanks.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Mathhax0r
1

I assume what you mean is to execute, not compile the code one line at a time.

I don't use Wing IDE, but virtually all IDE's have a built-in debugger. (If it doesn't, it's not an IDE, but just an editor.)

You need to set a breakpointt at the beginning of your code, then run it in the debugger. The execution will stop at the breakpoint, where you will be able to inspect local and global variables, and step through the code one line at the time. (To step through means the debugger will execute the next line of code and pause, so you can inspect your variables again.)

Look in the menus for terms like "debug", "step in", "step over", "run to cursor", "set breakpoint", "toggle breakpoint".

I hope this helped.

Edited by pythopian: n/a

0

Python has a built in debugger named pdb (Python DeBugger, lol) that will let you do just that.

Check out this article for its use and some other debugging

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.