shutil, biraz akıllı olsa... :)
This commit is contained in:
+2
-1
@@ -151,7 +151,8 @@ def clean_dir(path):
|
|||||||
# for name in dirs:
|
# for name in dirs:
|
||||||
# os.rmdir(os.path.join(root, name))
|
# os.rmdir(os.path.join(root, name))
|
||||||
# don't reimplement the wheel
|
# don't reimplement the wheel
|
||||||
shutil.rmtree(path)
|
if os.path.exists(path):
|
||||||
|
shutil.rmtree(path)
|
||||||
|
|
||||||
def dir_size(dir):
|
def dir_size(dir):
|
||||||
""" calculate the size of files under a dir
|
""" calculate the size of files under a dir
|
||||||
|
|||||||
Reference in New Issue
Block a user