cheatsheet.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:PyCheatsheets 作者: john-cd 项目源码 文件源码
def print_attributes(obj):
    for attr in obj.__dict__:
        print attr, getattr(obj, attr)

## pdb:
# https://docs.python.org/2/library/pdb.html
# http://web.archive.org/web/20120819135307/http://aymanh.com/python-debugging-techniques

## commands:
# help
# p pp # print, pretty print
# list args
# continue step next
# run restart
# where down up # print stack trace and move frame
# quit
# ;; (separator)
# [!]statement
# Commands that the debugger doesn’t recognize are assumed to be Python statements
# and are executed in the context of the program being debugged.
# Python statements can also be prefixed with an exclamation point (!).

## 1- in IPython, use %debug or %pdb

## 2- at the console prompt:
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号