Kaydet (Commit) a390c6e1 authored tarafından Tim Peters's avatar Tim Peters

walk() docs: Emphasize that the recursive-delete example is dangerous.

üst 5501b5e3
......@@ -1126,6 +1126,8 @@ directory is empty:
import os
from os.path import join
# Delete everything reachable from the directory named in 'top'.
# CAUTION: This is dangerous! For example, if top == '/', it
# could delete all your disk files.
for root, dirs, files in os.walk(top, topdown=False):
for name in files:
os.remove(join(root, name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment