gpt4 book ai didi

Python cprofile文件名:lineno get full path

转载 作者:行者123 更新时间:2023-12-02 11:17:08 35 4
gpt4 key购买 nike

我用 cprofile得到重犯,但是 filename:lineno仅列出文件名,但列出文件路径对于快速打开该路径会更有用。特别是如果不同层次结构中可能存在相同的模块名称。

ncalls    tottime    percall    cumtime    percall    filename:lineno(function)
1 0.000 0.000 3.922 display.py:599 (show)

有没有办法把它变成全路径?

最佳答案

我猜你用“pstats.Stats”类格式化输出,你有:

stats = Stats(profiler)
stats.strip_dirs() # remove this

关于Python cprofile文件名:lineno get full path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50731065/

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