View Single Post
  #3  
Old 04-02-2011, 01:56 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
It sounds like you just want an array of custom class objects. The following code shows how to create a simple class and add instances of it to a list:
Code:
class MyStruct(object):
    def __init__(self,my_int,my_float,my_string):
        self.my_int = my_int
        self.my_float = my_float
        self.my_string = my_string

array = []
array.append( MyStruct(0,0.0,'foo') )
array.append( MyStruct(1,1.0,'bar') )

print array[0].my_string
Let me know if this isn't what you are looking for.
Reply With Quote