Page 385 - Beginning Programming with Pyth - John Paul Mueller
P. 385
safeguards in place is always a good idea. You may want to remove other items, so here are other functions you should know about:
os.rmdir(): Removes the specified directory. The directory must be empty or Python will display an exception message.
shutil.rmtree(): Removes the specified directory, all subdirectories, and all files. This function is especially dangerous because it removes everything without checking (Python assumes that you know what you're doing). As a result, you can easily lose data using this function.
2. Click Run Cell.
The application displays the File Removed! message. When you
look in the directory that originally contained the ChangedFile.csv file, you see that the file is gone.