import re import os from random import randrange def new_upload(output_file): """ Extracts 1 to 3 sentences from input_file and writes them to output_file. """ num_sentences = randrange(1, 4) input_file = '../HP1.txt' index_file = '../read_index.txt' def read_sentences(file_path, start_index, num_sentences): sentences = [] with open(file_path, 'r') as file: text = file.read() sentences = re.split(r'(?