Solution: Most pythonic way to delete a file which may not exist

Development | Programming languages
Description
I want to delete the file filename if it exists.
Attachments
No attachments.
Solutions
import os

if os.path.exists("filename.txt"): os.remove("filename.txt")

on December 07th, 2018 (11:17 pm)
What masters said
You must sign in to comment!!
All comments
This solution has not been commented yet.