Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get all variables in class

vars = [attr for attr in dir(dino) if not callable(getattr(dino, attr)) and not attr.startswith("__")]
         
for v in vars:
	print("{0} = {1}".format(v,getattr(dino, v)))
 
PREVIOUS NEXT
Tagged: #python #variables #class
ADD COMMENT
Topic
Name
9+9 =