Is there a library equivalent of "rm -rf" ?

David Ascher DavidA at ActiveState.com
Wed Oct 30 18:09:32 EST 2002


Andrew Koenig wrote:

> I couldn't find a library function to (recursifely) remove a directory
> and everything in it.
>
> os.rmdir removes a directory, but only if it's empty.
>
> os.removedirs removes a file, then pruns empty directories above it.
>
> Did I miss something?

shutil.rmtree

--david





More information about the Python-list mailing list