Deleteing empty directories
andrew at acooke.org
Mon Mar 30 17:22:09 CEST 2009
> Hi All,
> I've been scratching my head all afternoon trying to work out the best/
> quickest way is to delete empty directories within a tree (Windows).
> I've looked at os.walk() but it seems to traverse the directory tree
> in the wrong order (is it possible to reverse the order?)
the documentation for os.walk() explains how to reverse the order.
> It seems the only way is to manually walk the tree myself recursively
> and then back up deleteing a directory if it is found to be empty.
> Any ideas?
> SHaun >8)
More information about the Python-list