Skip to main content Brad's PyNotes

Posts on Files

  1. CSV Module: Easy CSV File Reading and Writing

    TL;DR

    The csv module provides csv.reader(), csv.writer(), csv.DictReader(), and csv.DictWriter() for robust CSV file processing with automatic dialect detection and proper handling of quotes, delimiters, and line endings.

  2. Input Output Tutorial

    TL;DR

    Python provides multiple string formatting methods (f-strings, .format(), manual), file operations with context managers, and JSON serialization for data exchange.

    Interesting!

    F-strings can execute any Python expression inside the braces - you can even call functions and perform calculations right inside the string!