[Tutor] Debugger Needed

Alan Gauld alan.gauld at freenet.co.uk
Mon Feb 6 09:59:37 CET 2006


> I am new to python, I want to know how to use a debugger and which 
> debugger give a GUI .

If you are new to Python but experienced in programming then you should find
the pdb debugger is a lot like the GNU gdb one. Its not a GUI hiowever.
(Although I beliebe you can get it to work with ddx etc... but I haven't 
tried)

IDLE also has a somewhat cut down debugger built in and it is graphical but 
ugly!

Other IDEs like Blackadder etc also feature debuggers.

However in Python the most useful debugger is often the interactive prompt.
If you run your program with

python -i foo.py

the program will stop inside the interpreter so that you can examine 
variables etc.
coupled with judicial use of print statements you should rarely need the 
debugger
The other thing to do with the >>> prompt is simply import your module and
call the functions from the prompt. Again you can see the results by examing
variables etc.

HTH

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list