限制Python追溯输出仅在特定文件中的代码
我正在尝试在其呼叫订单中自动生成函数呼叫列表以进行文档目的,
python - m trace --trackcalls main.py
但是,使用我的文件运行跟踪模块似乎显示了所有呼叫,包括内置模块,而我只需要跟踪我写的源文件,以便我可以在文档中显示程序的工作流程。是否有任何仅获取指定源文件的跟踪的方便方法,或者我别无选择,只能编写一个额外的脚本进行原始跟踪输出并过滤它?
I am trying to automatically generate a list of function call in their call order for documentation purposes with something like
python - m trace --trackcalls main.py
however, running the trace module with my files seems to show ALL calls, including built-in modules, while I only need the trace for the source files written by me so that I can show the workflow of the program in the documentation. Is there any existing convenient way to only get the trace for specified source files or would I have no other choice but writing an additional script taking the raw trace output and filtering it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论