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.
Subscribe
Login
Please login to comment
0 Discussion