def rmglob ( pattern : str ) -> None : for f in glob . glob ( pattern ) : os . remove ( f )
python delete all files with a given extension
Deletes all files whose filename matches the glob pattern ( via : func : glob . glob ) .
def rmglob(pattern: str) -> None:
    """
    Deletes all files whose filename matches the glob ``pattern`` (via
    :func:`glob.glob`).
    """
    for f in glob.glob(pattern):
        os.remove(f)