I'm running a while loop in Python with this syntax:
while not endFound:
if file[fileIndex] == ';':
current = current + ';'
contents.append(current)
if fileIndex == lengthOfFile:
endFound = True
else:
current = current + file[fileIndex]
fileIndex = fileIndex + 1
And am getting this error in my console:
var(vari) = 0;terminal.write(vari);var(contents) = file.getContents('source.py');if(vari : 0) { terminal.write('vari equals 0');}
Traceback (most recent call last):
File "/home/ubuntu/workspace/source.py", line 30, in <module>
splitFile(content)
File "/home/ubuntu/workspace/source.py", line 22, in splitFile
if file[fileIndex] == ';':
IndexError: string index out of range
> Process exited with code: 1
What happened?