Take the 2-minute tour ×  Possible Duplicate: How do I
remove/delete a folder that is not empty with Python?  How do I
delete a file or folder in Python?  I am using the Python
scripting language running on the Windows XP operating system.
share|improve this question stackoverflow.com/questions/185936/…
–  Mob Aug 9 '11 at 13:08 read this documentation – 
CloudyMarble Aug 9 '11 at 13:09 This is not a duplicate because
removing a folder is not the same as removing file or folder and
the two require different code in Python. –  vitaut Jan 27 at
18:59 add comment  marked as duplicate by Jacob, Chris, agf,
katrielalex, Shadow Wizard Aug 9 '11 at 13:24   2 Answers  up
vote 139 down vote accepted  os.remove() will remove a file.
os.rmdir() will remove an empty directory.  shutil.rmtree() will
delete a directory and all its contents.  share|improve this
answer add comment  Use shutil.rmtree(path[, ignore_errors[,
onerror]]) (see compelte doc on shutil) and/or os.remove and
os.rmdir (complete doc on os)  share|impr