2

Hey i wanted to know how to remove a folder or a file with the module os in python.

def remove_folder():
        remoce_folder = str(input("What is the directory path of the folder: "))

How i can delet it. Can we do it with os.system(any Shell command) or a tiny os.del() Thanks

Nathor69
  • 35
  • 4
  • 1
    Does this answer your question? [How to delete a file or folder in Python?](https://stackoverflow.com/questions/6996603/how-to-delete-a-file-or-folder-in-python) – Flo Oct 29 '21 at 16:05
  • Try with `os.remove(file)` please read this https://www.w3schools.com/python/python_file_remove.asp – Dinesh s Oct 29 '21 at 16:06

0 Answers0