So what I'm looking for here is something like PHP's print_r function.
(所以我在这里寻找的是类似PHP的print_r函数。)
(这样一来,我可以通过查看问题对象的状态来调试脚本。)
You want vars() mixed with pprint() :
vars()
pprint()
(您想要vars()与pprint()混合:)
from pprint import pprint pprint(vars(your_object))
1.4m articles
1.4m replys
5 comments
57.0k users