Basically my problem is this:
I have a list containing integers. In this case, the integers reflect greyscale values for individual pixels. I've established a variable (xpixel) that is the width of the photo in pixels. When my list hits this number (Just after the xpixel-1 pixel integer) i need to add a special identifying character to signal that the line of pixels has been completed and to begin the next line. This continues at intervals of xpixel through the entire integer string.
So, how do i add an item to my list at exactly that given interval?
Something like this?:
j=0
for i in Pixels:
if j%xpixel==0 and j!=0:
pixel_corrected.append(i)
pixel_corrected.append('END PIXEL LINE')
j+=1
else:
pixel_corrected.append(i)
j+=1
Thanks in advance for the help.