Code: Alles auswählen
def delDir(directory):
for filename in glob.glob(directory + '/*'):
absPath = os.path.abspath(filename)
if os.path.isdir(absPath):
try:
os.rmdir(absPath)
except:
delDir(absPath)
else:
try:
os.remove(absPath)
except:
print 'Error: os.remove(%r) fehlgeschlagen!' % (absPath)
Danke im voraus.
Gruß Zack