The python readlines() function gives me a list, output, from file and I want to delete any line from output that is short the required number of list elements (14). I can print the index values of the lines concerned, but I can't delete the lines themselves - the objects are either unsubscriptable or don't support item deletion. Help!
output = src.readlines()
index = 0
for index, lines in enumerate(output):
lines = lines.split(',', 13)
if (len(lines) < 14):
print index # prints correct index value
del index # or output2[index] etc, fails