I'm new here and fairly new to Python. I am attempting to read a data file into python and adding it to a 2D list to make it easy to use further down the line.
My data file is just 7 numbers in a row seperated by commas and each bulk of data is seperated by the sign @ to indicate that the data from this point on should be stored into a new part of the 2D list.
After reading the file, the way I imagine the data to be shown would be in this manner:
data = (1,1,1,1,1,1,1)
data = (2,2,2,2,2,2,2)
data = (3,3,3,3,3,3,3)
data = (4,4,4,4,4,4,4)
This way it will be easy to loop across the data when I use it in Blender.
My code looks like this;
i = 0 object_data =  object_data.append() for rows in data.splitlines(): elems = rows.split(',') if elems != "@": object_data[i].append((float(elems),float(elems),float(elems),float(elems), float(elems),float(elems),int(elems))) else: **start on object_data and loop over it all again**
I could really use some help as to how I would force my code to not start on object_data on the next iteration in the for loop, but rather on object_data. I'm an avid Matlab user so I imagined this to be done simply by setting i=i+1 in the else part, however this does not work as it complains about the list being out of bounds.
Any help is really appreciated!