Jan-17-2020, 08:43 PM
No you must close the file. But you changed the indentation. It should be:
import time import schedule starttime=time.time() #Input_file: "C:\\Campbellsci\\LoggerNet\\CR1000_Table1.dat" #Output_file: "C:\\Users\\Makada\\Desktop\\CR1000_Table1 - kopie.dat" while True: """ Not to append duplicate data to output file""" existingLines = set(line.strip() for line in open("C:\\Users\\Makada\\Desktop\\CR1000_Table1 - kopie.dat")) outfile = open("C:\\Users\\Makada\\Desktop\\CR1000_Table1 - kopie.dat", "a+") for content in open("C:\\Campbellsci\\LoggerNet\\CR1000_Table1.dat", "r"): if content.strip() not in existingLines: # to void duplicate lines outfile.write(content) existingLines.add(content) outfile.close() time.sleep(60 - time.time() % 60)