Blog Archive for May 28, 2018

Grep in Python 2

May 28, 2018

Here's some quick example code I used to perform a grep in Python 2.

:::python import os, fnmatch, ConfigParser, time

def locate(pattern, root=os.curdir):
    """ 
    Locate all files matching supplied filename pattern in and
    below the supplied root directory
"""
for path, …

Tags: grep python