def deleteDirectory(directory, subfolderName):
 subDirectory = os.path.join(directory, subfolderName)
 if os.path.isdir(subDirectory):
  shutil.rmtree(subDirectory)

def deleteDirectory ( directory , subfolderName ) : subDirectory = os . path . join ( directory , subfolderName ) if os . path . isdir ( subDirectory ) : shutil . rmtree ( subDirectory )
delete the directory if it exists .