Created
November 26, 2018 15:15
-
-
Save adammhaile/7db654d997b035cbd340ece8f17c023a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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