The logic in your for loop is wrong. It's not checking whether the string is missing from the file, it's checking whether there's some line in the file that doesn't match the string. If the file is empty, the loop won't do anything, so it never sets found = 1.

You need to invert the logic. Change it to:

found = False
for line in lines:
if line == c:
found = True
break
if not found:
output_filee.write(c)