Jan-18-2020, 10:06 AM
Hi,
Ive made a change and added the schedule function.
Now the output is spot on on the minute like the source.
Thanks.
Ive made a change and added the schedule function.
Now the output is spot on on the minute like the source.
Thanks.
import time import schedule #starttime=time.time() def task(): #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() schedule.every().minute.at(":01").do(task) while True: schedule.run_pending() time.sleep(1) refresh()