所以我在这里寻找的是类似 PHP 的东西print_r功能。
这样我就可以通过查看相关对象的状态来调试我的脚本。
你要vars()夹杂pprint():
vars()
pprint()
from pprint import pprint pprint(vars(your_object))