Remove file using Python

Os module provides the functionality to remove files.

import os
os.remove(filename)

Here we need to replace 'filename' with the name of the file that need to be removed.

 

Leave a Reply

Your email address will not be published. Required fields are marked *