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.

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.

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