How to remove an empty directory using command line
xxxxxxxxxx
rmdir directoryname
Use the rmdir or rm -d command to remove empty directories. Use the rm -r command to remove non-empty directories.
xxxxxxxxxx
# Python program to explain os.rmdir() method
# importing os module
import os
# Directory name
directory = "Geeks"
# Parent Directory
parent = "D:/Pycharm projects/"
# Path
path = os.path.join(parent, directory)
# Remove the Directory
# "Geeks"
os.rmdir(path)