Python调试提示调试Python的最佳技巧是什么?请不要只列出一个特定的调试器,而不知道它实际能做什么。相关让我的Python代码第一次运行的好方法是什么?-这讨论了尽量减少错误
3 回答
慕沐林林
TA贡献2016条经验 获得超9个赞
# Ned's .pdbrc# Print a dictionary, sorted. %1 is the dict, %2 is the prefix for the names.alias p_ for k in sorted(%1.keys()):
print "%s%-15s= %-80.80s" % ("%2",k,repr(%1[k]))# Print the instance variables of a thing.alias pi p_ %1.__dict__ %1.
# Print the instance variables of self.alias ps pi self
# Print the locals.alias pl p_ locals() local:# Next and list, and step and list.alias nl n;;l
alias sl s;;l# Short cuts for walking up and down the stackalias uu u;;u
alias uuu u;;u;;u
alias uuuu u;;u;;u;;u
alias uuuuu u;;u;;u;;u;;u
alias dd d;;d
alias ddd d;;d;;d
alias dddd d;;d;;d;;d
alias ddddd d;;d;;d;;d;;d添加回答
举报
0/150
提交
取消
