Plain text is character data stored persistently in an encoded file. Python projects commonly read it programmatically so they can process data across many files, rather than relying on specialized software. section 11.1 section 11.1.1
Read task data as a string
A task-management file such as tasks.txt can contain rows like `1001,Homework,5`. Opening it in read mode and calling `read()` returns all file content as a Python `str`, which can then be split or otherwise processed. section 11.1.1
The built-in `open` function creates a text stream, commonly represented by an `_io.TextIOWrapper`. Its mode controls permitted operations: `r` reads without allowing writes. Close the file after processing, preferably with `with`, which releases the shared resource automatically when the block ends. section 11.1.1
Listing 11.2 Using with to open a file
with open("tasks.txt") as file: #1
print(f"file object: {file}")
data = file.read()
print(data)
# output the following lines:
file object: <_io.TextIOWrapper name='tasks.txt' mode='r' encoding='UTF-8'>
1001,Homework,5
1002,Laundry,3
1003,Grocery,4
Use the complete `with open(...)` example to see a readable pattern that opens tasks.txt, reads its contents, prints the result, and closes the file automatically. section 11.1.1

