The grep Module

The grep module provides different ways to search for text in text files, as Example 14-16 shows.

Example 14-16. Using the grep Module

File: grep-example-1.py

import grep
import glob

grep.grep("<rather>", glob.glob("samples/*.txt"))

# 4: indentation, rather than delimiters, might become
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.184.200