The find Module

(Only 1.5.2, Obsolete) The find module provides a single function, with the same name as the module: find(pattern, directory) => list scans a given directory and all its subdirectories for files matching a given pattern, as Example 14-36 shows.

For more information on the pattern syntax, see the fnmatch module.

Example 14-36. Using the find Module
File: find-example-1.py

import find

# find all JPEG files in or beneath the current directory
for file in find.find("*.jpg", "."):
 print file

.samplessample.jpg

Core Modules

More Standard Modules

Threads and Processes

Data Representation

File Formats

Mail and News Message Processing

Network Protocols

Internationalization

Multimedia Modules

Data Storage

Tools and Utilities

Platform-Specific Modules

Implementation Support Modules

Other Modules





Python Standard Library
Python Standard Library (Nutshell Handbooks) with
ISBN: 0596000960
EAN: 2147483647
Year: 2000
Pages: 252
Authors: Fredrik Lundh
Similar book on Amazon

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