HELP! Just when I get one thing working, something else doesn't work! Again, I'm sure it's simple to experienced eyes, but I'm struggling! This is the code where I generate my lists and the data for said lists.
#Frame Creation
allframes = []
for n in range (0, (workingframes*archnodes*3)):
allframes.append(n)
frames = allframes
print frames
#Frame Population
for f in range (0, workingframes):
if f<=(workingframes/2):
for x in range (0, (archnodes)):
frames[((archnodes*3)+f)].insert(((archnodes*3)+f), (archstartred[x]))
frames[((archnodes*3)+f+workingframes)].insert(((archnodes*3)+f+workingframes),(archstartgrn[x]))
frames[((archnodes*3)+f+workingframes*2)].insert(((archnodes*3)+f+workingframes*2),(archstartblu[x]))
for y in range (0, nodesperframe):
archstartred.pop()
archstartgrn.pop()
archstartblu.pop()
archstartred.insert(0, backred)
archstartgrn.insert(0, backgrn)
archstartblu.insert(0, backblu)
else:
for y in range (0, nodesperframe):
archstartred.pop(0)
archstartgrn.pop(0)
archstartblu.pop(0)
archstartred.append(backred)
archstartgrn.append(backgrn)
archstartblu.append(backblu)
for x in range (0, (archnodes)):
frames[(archnodes*3)+f].insert((archnodes*3), (archstartred[x]))
frames[(archnodes*3)+f+workingframes].insert(((archnodes*3)+1),(archstartgrn[x]))
frames[(archnodes*3)+f+workingframes*2].insert(((archnodes*3)+2),(archstartblu[x]))
I keep getting this lovely error:
AttributeError: 'int' object has no attribute 'insert'
I plan on converting the list to an array after the list is populated so that I can have it manipulated the way it needs to be. I'm sure there's a much easier way to do this, but I don't know and I'm new to Python!
frames = allframeswill not make a copy, so frames and allframes refer to the same list. If you need to make a copy, useframes = allframes[:]orframes = list(allframes).inserton the list, not an integer in the list - I updated my answer with some additional information about this, I hope it helps.