📜  python 打印类变量 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:51.167000             🧑  作者: Mango

代码示例1
# to print out the variable names
print(vars(YourClass))

# to print out names and values
for var in vars(YourClass):
    print(getattr(YourClass, var))