INNER CODE UNIT · Python

_expand

webartifex/intro-to-python · noxfile.py:118

def _expand(*patterns):
    """Expand glob patterns into paths.

    Args:
        *patterns: the patterns to be expanded

    Yields:
        path: a single expanded path
    """
    for pattern in patterns:
        yield from glob.glob(pattern.strip())


@contextlib.contextmanager
def _line_by_line_replace(path):
    """Replace/change the lines in a file one by one.

    This generator function yields two file handles, one to the current file

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…