简体   繁体   English

如何编辑Graphite Python源文件进行调试?

[英]How can I edit Graphite Python source files to debug?

I'm using the Graphite charting library and I'd like to edit the source files to debug a problem. 我正在使用Graphite图表库,我想编辑源文件来调试问题。

Specifically, I'd like to edit graphite/webapp/graphite/render/gylph.py drawGraph() function. 具体来说,我想编辑石墨/ webapp /石墨/渲染/gylph.py drawGraph()函数。

But when I change the code and render a chart, which was producing an error in that area of the code, my edited code does not seem to execute. 但是,当我更改代码并绘制图表时,在该代码区域中产生了错误,我的编辑代码似乎无法执行。

In fact I can delete that entire file and the pyc file and the code still seems to run. 实际上,我可以删除整个文件和pyc文件,并且代码似乎仍然可以运行。

You can use the built in debugger of python, pdb. 您可以使用python的内置调试器pdb。 Put in the source you want to edit: 输入您要编辑的源:

import pdb
pdb.set_trace() 

just before the place you want to stop execution and examine the problem. 在您要停止执行并检查问题的位置之前。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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