标签:pre div from size join http 递归 pat turn
不使用递归
import os from os.path import join, getsize def getdirsize(dir): size = 0 for root, dirs, files in os.walk(dir): size += sum([getsize(join(root, name)) for name in files]) return size size = getdirsize(r‘D:\python_code‘) print(‘There are %.3f‘ % (size / 1024 / 1024), ‘Mbytes in D:\\python_code‘)
标签:pre div from size join http 递归 pat turn
原文地址:https://www.cnblogs.com/wengshaohang/p/12612218.html