【发布时间】:2019-11-25 12:04:54
【问题描述】:
经过长时间的函数调用(16 小时),我提前用 KeyboardInterrupt 结束了它,但意外也中断了 cProfile,因为它需要很长时间才能响应。在 Debug Stackviewer 中,我遇到了这样的问题:
- 键盘中断:
- idlelib.run.runcode (...)
- __ 主 __. (...)
- cProfile.run (...)
- profile.run (...)
- profile._show (...)
- cProfile.print_stats (...)
- importlib._bootstrap._find_and_load (...)
- importlib._bootstrap._find_and_load_unlocked (...)
- importlib._bootstrap.find_spec (...)
- importlib._bootstrap._get_spec (...)
- importlib._bootstrap.find_spec (...)
- importlib._bootstrap._path_stat (...)
有没有办法恢复 cProfile 打印的内容,有没有办法更巧妙地使用 cProfile 进行过长的函数调用。
【问题讨论】:
标签: python recovery keyboardinterrupt