def remove_folder_content(path, ignore_hidden_file=False):
    """
    Remove all content in the given folder.
    """
    for file in os.listdir(path):
        if ignore_hidden_file and file.startswith('.'):
            continue

        file_path = os.path.join(path, file)
        if os.path.isdir(file_path):
            shutil.rmtree(file_path)
        else:
            os.remove(file_path)
def remove_folder_content ( path , ignore_hidden_file = False ) : for file in os . listdir ( path ) : if ignore_hidden_file and file . startswith ( '.' ) : continue file_path = os . path . join ( path , file ) if os . path . isdir ( file_path ) : shutil . rmtree ( file_path ) else : os . remove ( file_path )
Remove all content in the given folder.