Python 获取文件夹的大小,python获取文件夹,[Python]代码im
Python 获取文件夹的大小,python获取文件夹,[Python]代码im
[Python]代码
import osfrom os.path import join, getsizedef getdirsize(dir): size = 0L for root, dirs, files in os.walk(dir): size += sum([getsize(join(root, name)) for name in files]) return sizeif '__name__' == '__main__': filesize = getdirsize(r'c:\windows') print 'There are %.3f' % (size/1024/1024), 'Mbytes in c:\\windows'
相关内容
- python四舍五入,,python的内置函数r
- python 使用MySQLdb连接mysql,pythonmysqldb,MySQLdb顾名思义,
- python处理JSON中的浮点数不精确问题,pythonjson浮点数,有
- python 缩略图,给图片加水印,,这里使用了PIL类库。[
- python比较两个文件的差异,python两个差异,下面的pytho
- Python 求解组合问题,python求解组合,[Python]代码de
- Python sqlite模块,pythonsqlite模块,sqlite是非常著名的
- Python删除指定目录下的过期文件,,实现类似该命令的操
- MySQLdb and threading Base Usage,mysqldbthreading,[Python]代码im
- Python 读取纯真IP数据库,pythonip数据库,[Python]代码#!
评论关闭