Chapter 4. Files


    Section 4.1.  Introduction

    Section 4.2.  Reading from a File

    Section 4.3.  Writing to a File

    Section 4.4.  Searching and Replacing Text in a File

    Section 4.5.  Reading a Particular Line from a File

    Section 4.6.  Retrieving a Line at Random from a File of Unknown Size

    Section 4.7.  Counting Lines in a File

    Section 4.8.  Processing Every Word in a File

    Section 4.9.  Reading a Text File by Paragraphs

    Section 4.10.  Reading Lines with Continuation Characters

    Section 4.11.  Reading Data from ZIP Files

    Section 4.12.  Reading INI Configuration Files

    Section 4.13.  Sending Binary Data to Standard Output Under Windows

    Section 4.14.  Using Random-Access Input/Output

    Section 4.15.  Updating a Random-Access File

    Section 4.16.  Splitting a Path into All of Its Parts

    Section 4.17.  Treating Pathnames as Objects

    Section 4.18.  Creating Directories Including Necessary Parent Directories

    Section 4.19.  Walking Directory Trees

    Section 4.20.  Swapping One File Extension for Another Throughout a Directory Tree

    Section 4.21.  Finding a File Given an Arbitrary Search Path

    Section 4.22.  Finding a File on the Python Search Path

    Section 4.23.  Dynamically Changing the Python Search Path

    Section 4.24.  Computing Directory Sizes in a Cross-Platform Way

    Section 4.25.  File Locking Using a Cross-Platform API

    Section 4.26.  Versioning Filenames

    Section 4.27.  Module: Versioned Backups



Python Cookbook
Python Cookbook
ISBN: 0596007973
EAN: 2147483647
Year: 2005
Pages: 346

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net