def ADD_DATA(checkpoint_csv): current_checkpoint = [CURRENT_TIME()] with open(checkpoint_csv, "a", newline="") as file: writer = csv.writer(file) writer.writerow(current_checkpoint) print(' ') MainDataFile = open('data/' + str(CURRENT_TIME()) + '.txt', 'w') MainDataFile.write(str(DataModule.GETCOIN())) MainDataFile.close() CHECK_TIMER(timerequest)
if DataPath: print(' ') else: print(' ') return DataPath def GET_LAST_CHECKPOINT(): with open('data/checkpoints.csv', 'r') as fp: reader = csv.reader(fp) data_read = [row for row in reader] last_checkpoint_list_unit = str(data_read[len(data_read) - 1]) last_checkpoint = int(last_checkpoint_list_unit[2:-2]) return last_checkpoint GET_LAST_CHECKPOINT() current_time = int(time.time()) last_checkpoint = GET_LAST_CHECKPOINT() def DATA_MEGERING(): CheckpointMegering = current_time - last_checkpoint return CheckpointMegering DATA_MEGERING() open(str(CURRENT_TIME()) + '.txt', 'w') close() print(DataModule.GETCOIN())