
Reet C. answered 05/03/19
Tutor
5
(10)
Computer Engineer With A Passion For Teaching!
Quoted from StackOverflow on the subject:
os.remove() # removes a file.
os.rmdir() # removes an empty directory.
shutil.rmtree() # deletes a directory and all its contents.
pathlib.Path.unlink() # removes the file or symbolic link.
pathlib.Path.rmdir() # removes the empty directory.