To delete a file using python you can use the following snippet.

Sample Python

import os  
try: os.unlink('filpath')  
except OSError: pass # failed...

One thought on “How to delete a file using python”

Leave a Reply