gpt4 book ai didi

python - line_profiler 不返回任何输出

转载 作者:行者123 更新时间:2023-11-28 18:39:40 26 4
gpt4 key购买 nike

我已经使用 pip install line_profiler 安装了 line_profiler。我在 Mac OSX 10.8.5 上使用 Python 2.7。

我运行 kernprof -l ~/Desktop/sum.py,然后得到

(default code output)
Wrote profile results to sum.py.lprof

但是然后运行 ​​python -m line_profiler sum.py.lprof 给我:

Timer unit: 1e-06 s

并且没有其他输出。我的程序代码在这里:sum.py .

最佳答案

jonrsharpe 的评论是正确的,我忘记在函数头之前添加@profile。

关于python - line_profiler 不返回任何输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27985156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com