rm -rf in python?

Ganesan R rganesan at myrealbox.com
Fri Nov 15 00:49:23 EST 2002


>>>>> "VanL" == VanL  <vlindberg at verio.net> writes:

> Is there a way (short of executing a shell command) that I can do a rm
> -rf on a directory from python?  It raises an OSError if you try to
> delete a directory that has contents.  I suppose that I could recurse
> down through, deleteing as I went, but it seems that there must be an
> easier way.

shutil.rmtree()

Ganesan

-- 
Ganesan R



More information about the Python-list mailing list