这是一个实用程序模块,有助于使用以下功能调试 python 源代码
该模块在几个关键方面为开发人员提供帮助,特别是在调试和维护代码方面。以下是主要好处:
通过利用 whoami、whereami、whocalledme、calledtree 和 whosdaddy,开发人员可以创建更健壮、可维护且更易于调试的代码。
from pdbwhereami import whoami, whereami, whocalledme, calledtree, whosdaddy def debug_utility(): whoami() whoami("I am in test_whoami function") print() whereami() whereami("I am in test_whereami") whereami(obsolete_path = True) whereami(path_depth=6) print() whocalledme() whocalledme(obsolete_path = True) whocalledme(path_depth=6) print() calledtree() tstr = calledtree(verbose=False) print(tstr) calledtree(tree_depth=1) calledtree(tree_depth=2) print() whosdaddy() debug_utility()
[debug_utility] -> [debug_utility] -> I am in test_whoami function [whereami/main.py:71]:debug_utility -> [whereami/main.py:72]:debug_utility -> I am in test_whereami [/home/bhagavan/whereami/main.py:73]:debug_utility -> [/home/bhagavan/whereami/main.py:74]:debug_utility -> [whereami/main.py:93]:-> [/home/bhagavan/whereami/main.py:93]: -> [/home/bhagavan/whereami/main.py:93]: -> #1[/home/bhagavan/whereami/main.py:84]:debug_utility ] ->
pip install pdbwhereami
git clone https://github.com/bhagavansprasad/pdbwhereami.git cd pdbwhereami pip insall ./
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3