testing print driver with custom_.txt

This commit is contained in:
Bryan Gerlach
2025-12-10 16:35:30 -06:00
parent 1287e7e5df
commit ceaf44f71d
4 changed files with 38 additions and 37 deletions

View File

@@ -35,14 +35,15 @@ def remove_line_block(filepath, start_phrase, lines_to_remove_after_start):
# Note: We subtract 1 because the 'continue' will handle the first line removal immediately
continue
# If we are not skipping, keep the line
# If we are not skipping, keep the line, but change custom.txt to custom_.txt
line = line.replace("custom.txt", "custom_.txt")
lines_to_keep.append(line)
except FileNotFoundError:
print(f"Error: File not found at {filepath}")
return
# 3. Write the remaining lines back to the file (with backup)
# 3. Write the remaining lines back to the file
try:
with open(filepath, 'w') as file:
file.writelines(lines_to_keep)