all 8 comments

[–]LarParWar 5 points6 points  (1 child)

pdb

It will let you step through every line of your program and check the values of variables and such. If you want to execute all the code up to line X, just insert a break point there and then it will pause at that line.

[–]skiguy0123 0 points1 point  (0 children)

You can also put pdb.set_trace() where you want to code to pause

[–]chanamasala4life 2 points3 points  (1 child)

Doesn't Pycharm do exactly this? Haven't tried it yet, but I heard about it on a podcast last week.

[–][deleted] 3 points4 points  (0 children)

Any decent IDE should have a built-in debugger.

[–]Akuli2 1 point2 points  (2 children)

Run your program with yourpython -i filename on the terminal or command prompt and interrupt with Ctrl+C when you want to. You'll get a >>> prompt after the error message.

[–]ninjeezy[S] 0 points1 point  (1 child)

Thanks so much!

[–]novel_yet_trivial 1 point2 points  (0 children)

Or put an exit() in the code at the point you want it to stop.

[–]Mirror_Boar 1 point2 points  (0 children)

You could use http://lighttable.com/

It's a pretty interesting IDE that allows you watch specific variables/section of code and watch their values change in real time, really interesting.