views:

82

answers:

3

Hello all,

I am just wondering if there is a way to add breakpoints in IDLE so that I can stop at a point in my script and write other lines in the idle shell for testing. If not, is there other software that can do this?

+3  A: 

http://docs.python.org/library/pdb.html

gruszczy
+1. PDB is an essential tool.
Manoj Govindan
+5  A: 

you can add the line

import pdb; pdb.set_trace()

anywhere in your code, when reached it will drop you into a debug shell. so useful i have an emacs shortcut to add the snippet.

you may also want to look at ipdb, and use

import ipdb; ipdb.set_trace()

instead

second
+1 for added explanation.
Manoj Govindan
Thanks, +1 for explanation
Richard
+1  A: 

If you are running Windows, you might look at PyScripter if you want a development environment with more features than IDLE.

kindall
+1 only been using PyScripter for about a half hour, but am already preferring it over IDLE
Richard