def remove_files(root_dir):
    """
    Remove all files and directories in supplied root directory.
    """
    for dirpath, dirnames, filenames in os.walk(os.path.abspath(root_dir)):
        for filename in filenames:
            os.remove(os.path.join(root_dir, filename))

        for dirname in dirnames:
            shutil.rmtree(os.path.join(root_dir, dirname))
def remove_files ( root_dir ) : for dirpath , dirnames , filenames in os . walk ( os . path . abspath ( root_dir ) ) : for filename in filenames : os . remove ( os . path . join ( root_dir , filename ) ) for dirname in dirnames : shutil . rmtree ( os . path . join ( root_dir , dirname ) )
Remove all files and directories in supplied root directory.