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