A Python script to format text files for small e-reader devices with limited display capabilities.
- Characters per row: 21
- Rows per page: 8
- Words are not split across line breaks
python ebook_formatter.py input_file.txtThis will create a formatted file named input_file_formatted.txt
python ebook_formatter.py input_file.txt output_file.txtpython ebook_formatter.py sample_ebook.txt- ✓ Formats text to fit exactly 21 characters per line
- ✓ Keeps words intact (no word splitting)
- ✓ Preserves text content and order
- ✓ UTF-8 encoding support
- Reads your input text file
- Splits text into individual words
- Builds lines by adding words without exceeding 21 characters
- Saves the formatted output to a new file
ebook_formatter.py- Main formatting scriptsample_ebook.txt- Example input file for testingREADME.md- This file
- Python 3.6 or higher
- No external dependencies required