代码之家  ›  专栏  ›  技术社区  ›  Matt Joiner

pyerr打印()的python等价物

  •  1
  • Matt Joiner  · 技术社区  · 15 年前

    python api相当于什么 PyErr_Print() ,从C接口?

    我假设有一个电话 sys traceback 模块,但在其中找不到任何调用 Pyerr_print()打印 .

    附录

    我正在调用python以获得与 PyErr_PrintEx() ,描述为:

    Print a standard traceback to sys.stderr and clear the error indicator.
    

    那就是我想做的 蟒蛇 具有此效果的调用。

    1 回复  |  直到 15 年前
        1
  •  2
  •   Alex Martelli    15 年前

    没有一个python函数与 PyErr_PrintEx (的真实姓名 PyErr_Print ;-),包括例如设置 sys.last_traceback 和朋友(只应设置为帮助从交互式解释器进行事后调试,以排除 被抓住了。您要寻找的功能的具体组合是什么?