Deleteing empty directories

CinnamonDonkey CinnamonDonkey at googlemail.com
Mon Mar 30 10:50:22 EDT 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?)

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?

Cheers,
SHaun >8)




More information about the Python-list mailing list