Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
python delete directory if exists 1

python delete directory if exists

May 13, 2022 by Anurag batra
import shutil

shutil.rmtree('/folder_name')

Here is what the above code is Doing:
1. Importing the shutil module.
2. Deleting the folder named ‘folder_name’ and everything inside it.

Categories Python Examples
Post navigation
pandas join series
mean of a column pandas
© MyEduKit - 2022 . All Rights Reserved.