pythonfile-iodirectorydelete-file

How can I delete a file or folder in Python?


How can I delete a file or folder in Python?


Solution

  • Use one of these methods:


    On Python 3.3 and below, you can use these methods instead of the pathlib ones: