简体   繁体   中英

Sublime, Python, web servers and setting breakpoints

What's the recommended method to debug Python web servers (I have Plone/Zope) with Sublime Text 2?

  • Set real breakpoints in the text editor...

  • ... preferably through line context sensitive command and have a marker in the text editor margin ...

  • ...then have a running Python web server (local process) instantly honour the breakpoints without restart...

  • ... and when hitting the breakpoint open a debug prompt in a terminal or some other window, can be pdb

The goal is that the breakpoints would not be hard import pdb ; pdb.set_trace() import pdb ; pdb.set_trace() style breakpoints as you need to restart the software to skip such breakpoint and you cannot enable / disable it run-time.

Platform: OSX.

mr.freeze provides a way to set a breakpoint in a running Zope instance without restarting, and a sample script for integrating it with TextMate (triggered via a key shortcut). It would take a bit of work to turn it into a Sublime Text plugin, but it would be a good starting point.

The sample TextMate scripts are in the README but not released.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM