[python]获取文件夹大小

import os
from os.path import join, getsize

adrFloder = "E:\\pythontest\\adr"
iosFloder = "E:\\pythontest\\ios"

for root, dirs, files in os.walk(iosFloder):
    ##print  (root,dirs,files)
    for name in files:
        print( root, name, getsize(join(root, name) ))
        adrRoot = root.replace(iosFloder,adrFloder)
        print( adrRoot, name, getsize( join(adrRoot,name)) )
    

你可能感兴趣的:([python]获取文件夹大小)