gpt4 book ai didi

python - Kernprof (line_profiler) : how to output result as text instead of a binary file

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

运行 kernprof 时:

kernprof -l script_to_profile.py

输出存储在二进制文件中,可以在终端/命令行中读取。

有没有办法将结果输出到文本文件?

这似乎是一个有用的功能,但在文档或其他帖子中找不到。

最佳答案

python -m line_profiler script_to_profile.py.lprof > profile_output.txt

将二进制输出转换为文本文件(感谢@martineau)

关于python - Kernprof (line_profiler) : how to output result as text instead of a binary file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55973238/

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