Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Efficient way to print class values

$
0
0

Hello,
Im looking for a efficient way to print all of the class variables from a class. I now use the following code, that works, but doesn’t really look efficient.

for i in range(0, x):
    print(ClassData[i].a) 
    print(ClassData[i].b)
    print(ClassData[i].c)

I was thinking of looping through the variables, so you would loop from 0 to x and from a to c. Im not sure how to access those variable names within the class. Any suggestion might be appreciated, thanks.

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles