简体   繁体   中英

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.

Specifically, I'd like to edit graphite/webapp/graphite/render/gylph.py drawGraph() function.

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.

You can use the built in debugger of 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.

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