glob.iglob()
glob.iglob() is a Python function in the Glob Module category. Like glob() but returns an iterator instead of a list (memory efficient). The syntax is glob.iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False). Returns: Iterator of path strings. A typical example: for f in glob.iglob("data/*.csv"):
process(f). A close sibling is glob.glob(), which returns a list of file paths matching a pathname pattern. More about this category: File pattern matching — glob, iglob. Related Glob Module entries: glob.glob(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try glob.iglob() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.