Files, Paths, and Directories# Path Strings Absolute and Relative Paths Cross-Platform Path Separators Finding the Current Directory Reading Files Opening and Reading Line by Line Reading the Entire File at Once Example: Summing a File of Numbers Checking Whether a File Exists Writing Files Write Mode Append Mode Example: Copy a File to Upper Case Writing Formatted Data Working with pathlib Creating Path Objects Path Attributes Checking Existence Listing Directory Contents Reading and Writing via Path Chapter Review Questions