调试选项w/ Python、Flask和Sublime Text 2

时间:2022-01-19 16:43:10

I have just switched to Sublime Text 2 for my Python development. I usually do web programming with the Flask micro framework.

我刚刚为我的Python开发切换到崇高的文本2。我通常使用Flask微框架进行web编程。

What are my debugging options with this combination, and how do I set it up? I'm working on Windows 7.

使用这个组合我的调试选项是什么,我如何设置它?我正在开发Windows 7。

1 个解决方案

#1


9  

Use pdb:

使用pdb:

import pdb; pdb.set_trace()

(or the even better pdb++)

(或者更好的pdb++)

Also, Flask already include Werkzeug which contains an interactive JavaScript based in-browser debugger, I highly recommend you utilize it.

另外,Flask已经包含了Werkzeug,它包含一个基于浏览器内调试器的交互式JavaScript,我强烈建议您使用它。

(if your Flask uses uWSGI you can check out this guide to make Werkzeug debugger work: debugging flask application under uWSGI)

(如果您的Flask使用uWSGI,您可以查看本指南以使Werkzeug调试器工作:在uWSGI下调试Flask应用程序)

#1


9  

Use pdb:

使用pdb:

import pdb; pdb.set_trace()

(or the even better pdb++)

(或者更好的pdb++)

Also, Flask already include Werkzeug which contains an interactive JavaScript based in-browser debugger, I highly recommend you utilize it.

另外,Flask已经包含了Werkzeug,它包含一个基于浏览器内调试器的交互式JavaScript,我强烈建议您使用它。

(if your Flask uses uWSGI you can check out this guide to make Werkzeug debugger work: debugging flask application under uWSGI)

(如果您的Flask使用uWSGI,您可以查看本指南以使Werkzeug调试器工作:在uWSGI下调试Flask应用程序)