How to get the list of all initialized objects and function definitions alive in python?

前端 未结 4 1767
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 01:09

Say that in the python shell (IDLE) I have defined some classes, functions, variables. Also created objects of the classes. Then I deleted some of the objects and created so

4条回答
  •  攒了一身酷
    2020-12-29 01:49

    How about dir() which will output instantiated objects as a list? I just used this just now: [x for x in dir() if x.lower().startswith('y')]

提交回复
热议问题