import glob
import re


def find_file(pattern, path):
    """
    A bit like grep. Finds a pattern, looking in path. Returns the filename.
    """
    for fname in glob.iglob(path):
        with open(fname) as f:
            if re.search(pattern, f.read()):
                return fname
    return