gpt4 book ai didi

Python 调用 C : how could C send Python's line number it has been called from?

转载 作者:行者123 更新时间:2023-11-28 16:42:37 26 4
gpt4 key购买 nike

我有一个 Python 代码调用一些 C 代码(.so 文件)。

有没有办法从 C 代码中获取在 Python 端调用它的行号?

最佳答案

我最终找到了 PyFrame_GetLineNumber(PyFrameObject *f) C 函数,其源代码位于 frameobject.c

关于Python 调用 C : how could C send Python's line number it has been called from?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17348492/

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