Yesterday I made a simulation using Python. I had a few difficulties with variables and debugging.
Is there any software for Python, which provides a decent debugger?
Related question: What is the best way to debug my Python code?
Directly use command python pdg-debug.py without -m pdb to run the code. The program will automatically break at the position of pdb. set_trace() and enter the pdb debugging environment. You can use the command p variable to view the variables or use the command c to continue to run.
For a larger program, we may not want to step through the code from the beginning as it may take a long time before we reach the line that we are interested in. Therefore, debuggers also provide a breakpoint feature that will kick in when a specific line of code is reached.
But when it comes to Python, debugging “out of the box” is a little bit cruder and primitive; single-step debugging is the main way to debug Python code, and is quite slow and clunky. It's just easier to use print statements; Python founder Guido van Rossum (reportedly) uses them for 90 percent of his debugging.
Winpdb is a platform independent graphical GPL Python debugger with support for remote debugging over a network, multiple threads, namespace modification, embedded debugging, encrypted communication and is up to 20 times faster than pdb.
Features:
(source: winpdb.org)
pudb is a visual debugger for python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With