def clear_temp(wdir, rmdir=True):
    """Remove all files in wdir"""
    wdir = pathlib.Path(wdir)
    extensions = ["*.log", "*.dat", "*.txt"]

    for ext in extensions:
        for ff in wdir.glob(ext):
            ff.unlink()

    if rmdir:
        wdir.rmdir()
def clear_temp ( wdir , rmdir = True ) : wdir = pathlib . Path ( wdir ) extensions = [ "*.log" , "*.dat" , "*.txt" ] for ext in extensions : for ff in wdir . glob ( ext ) : ff . unlink ( ) if rmdir : wdir . rmdir ( )
Remove all files in wdir