Python list of class attributes Python

Python list of class attributes - Python

  • import inspect
  •  
  • class aClass:
  •     aMember = 1
  •     def aFunc():
  •         pass
  •  
  • inst = aClass()
  • print inspect.getmembers(inst)
  • 原文地址:https://www.cnblogs.com/lexus/p/2780837.html