Easiest way to rm -rf in Python

Issue

What is the easiest way to do the equivalent of rm -rf in Python?

Solution

import shutil
shutil.rmtree("dir-you-want-to-remove")

Answered By – Josh Gibson

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published