def remove_file(filepath, dry_run=False):
    """Remove the file at filepath

    Catches exception if the file does not exist.

    If dry_run is True, print name of file to be removed, but do not remove it.
    """
    if dry_run:
        sys.stdout.write("rm %s\n" % filepath)
    else:
        try:
            os.remove(filepath)
        except OSError:
            pass
def remove_file ( filepath , dry_run = False ) : if dry_run : sys . stdout . write ( "rm %s\n" % filepath ) else : try : os . remove ( filepath ) except OSError : pass
Remove the file at filepath

    Catches exception if the file does not exist.

    If dry_run is True, print name of file to be removed, but do not remove it.