Untitled
# Python code to generate 1 billion repeats in chunks text = "I love you more, Rowena.\n" repeats = 1000000000 # 1 billion chunk_size = 1000000 # Save in chunks of 1 million lines at a time # Open the file in append mode with open("repeats.txt", "w") as file: for i in range(0, repeats, chunk_size): # Write a chunk of lines at a time file.writelines([text] * chunk_size) print("File generation complete!")
Leave a Comment