I have just switched to Sublime Text 2 for my Python development. I usually do web programming with the Flask micro framework.
What are my debugging options with this combination, and how do I set it up? I'm working on Windows 7.
Use ctrl+shift+b to toggle breakpoint in a line Show activity on this post. You could try to use an IDE specific for Python which makes debugging and setting up python projects really easy. I would recommend you try the free community version of Pycharm.
As of Flask 2.2, to run in debug mode, pass the --app and --debug options to the flask command. If you're using the app. run() method instead of the flask run command, pass debug=True to enable debug mode. Tracebacks are also printed to the terminal running the server, regardless of development mode.
Java Prime Pack Debugging is the process of finding errors and bugs in the given code and fixing them. Sublime editor includes various plugins that have debugging features, which helps in finding errors easily. It is an extension used for debugging the PHP files and scripts.
Use pdb:
import pdb; pdb.set_trace()
(or the even better pdb++)
Also, Flask already include Werkzeug which contains an interactive JavaScript based in-browser debugger, I highly recommend you utilize it.
(if your Flask uses uWSGI
you can check out this guide to make Werkzeug debugger work: debugging flask application under uWSGI)
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