The grep module

(Obsolete; removed in 2.0) This module provides different ways to search for text in text files.

The grep function takes a regular expression (using the old regex syntax, and a list of files to search.

Example: Using the grep module
# File: grep-example-1.py

import grep
import glob

grep.grep("\<rather\>", glob.glob("samples/*.txt"))
$ python grep-example-1.py
4: indentation, rather than delimiters, might become
 

[comment on/vote for this article]

A Django site. this page was rendered by a django application in 0.02s 2008-10-11 00:03:17.924933. hosted by webfaction.