Skip to content
Snippets Groups Projects
Commit 2f304d0a authored by Amandine  PERRIN's avatar Amandine PERRIN
Browse files

Function to remove a file only if it exists

parent 5c2ec9bf
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -628,3 +628,12 @@ def write_list(liste):
"""
list_write = [str(l) for l in liste]
return " ".join(list_write) + "\n"
def remove(infile):
"""
Remove the given file if it exists
"""
if os.path.isfile(infile):
os.remove(infile)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment