【问题标题】:How to use the active state recipe for debugging?如何使用活动状态配方进行调试?
【发布时间】:2021-03-16 09:23:57
【问题描述】:

我在看到this answer on 'How to find where a running python program is getting hung?' 时遇到了this active state recipe。 我承认我是 python 的菜鸟。这个怎么用?

【问题讨论】:

    标签: python debugging


    【解决方案1】:

    我假设您已将活动状态配方作为“hung.py”保存在与原始挂起程序相同的文件夹中。

    • 获取挂起的python程序的进程id(pid)。说 123(提示:使用 htop)
    • 转到终端并输入 python hung.py 123 (使用正确的 pid 而不是 123)
    • 你已经完成了。

    【讨论】:

      猜你喜欢
      • 2016-01-06
      • 2019-05-04
      • 2019-07-19
      • 2019-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多