[Tutor] remove not-empty directory

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Mar 31 09:36:09 CEST 2006


[kakada]

| Just a quick question again, how can I remove not-empty 
| directory in python?
| 
| assumed I have the following directory:
| 
| ( temp/a/b/
|   temp/a/c/d.odt
|   temp/e.xml)
| 
| I want to remove the whole temp/ directory.

Look at the shutil module, and in particular at the rmtree function

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Tutor mailing list