How to delete a file in python?
In every language, deleting a file is an important task. So here we’ll see how to delete a file in python.
We have to import os module to remove a file.
import os os.remove("filename.txt")
import os os.rmdir("directory name")
In this way we can remove file and directory from our system.
Please login to comment
View all comments