我是python编程方面的新手。我试着学习cProfiler并使用pyprof2calltree。我使用python2.7,windows 7 .I安装了pyprof2calltree 1.3.2和qcachegrind074 -x86。问题是我找不到任何关于在windows中使用qcachegrind074的教程,而且所有代码都在另一个操作系统中。我编写了非常简单的代码(下面的代码),.I只是想创建一个kgring,但是引发了错误!在这些代码中,我的问题在哪里?我如何创建一个kgring文件?
def r():
print range(1,1000)
if __name__ =='__main__':
from cProfile import Profile
profiler = Profile()
profiler.run('r()')
from pyprof2calltree import convert, visualize
visualize(profiler.getstats())
convert(profiler.getstats(), 'c:/profiling_results.kgrind')这些错误是:
回溯(最近一次调用):文件“C:/././pyprof2示例,第11行,在可视化( profiler.getstats() C:...\lib\pyprof2calltree.py)文件”中,第306行,在converter.visualize()文件"C:...\lib\pyprof2calltree.py“中,第145行,在可视化self.output(f)文件"C:...\lib\pyprof2calltree.py”中,第133行,在output self._entry(entry)文件"C:\P...\lib\pyprof2calltree.py“中,第208行用于子条目的_entry,在calls中的call_info : ValueError:太多的值以解包
谢谢
发布于 2014-07-21 08:11:56
似乎您必须通过cmd行执行代码。这里是讨论的焦点。
https://stackoverflow.com/questions/24851623
复制相似问题