Python - Debug running application
I'm trying to fix bugs from gedit plugins. Gedit uses C but some 开发者_如何学编程of its plugins are in Python. My computer is old and I cannot run an IDE. I've read about PDB (Python Debugger), but i cannot call the plugin directly with PDB. Is it possible set breakpoints in a gedit plugin, run gedit and then use PDB to debug?
You could try editing the gedit plugins that you want to debug and putting
import pdb; pdb.set_trace()
in there and that should break into the debugger. You might need to launch gedit from a command prompt instead of the GUI so that it has a terminal for pdb to run in.
AFAIK you can't really use gedit for python debug but you can try WINPDB http://winpdb.org/ which can be used in parallel with gEdit
精彩评论