Skip to content

Instantly share code, notes, and snippets.

@adammhaile
Created November 26, 2018 15:15
Show Gist options
  • Save adammhaile/7db654d997b035cbd340ece8f17c023a to your computer and use it in GitHub Desktop.
Save adammhaile/7db654d997b035cbd340ece8f17c023a to your computer and use it in GitHub Desktop.
def rmdir(path, recursive=True):
for f in os.listdir(path):
fu = os.path.join(path, f)
if os.path.isfile(file_path):
os.unlink(file_path)
elif recursive and os.path.isdir(file_path):
shutil.rmtree(file_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment