• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            我希望你是我獨家記憶

            一段永遠封存的記憶,隨風而去
            posts - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            python獲取文件夾大小(1)

            Posted on 2009-07-28 14:07 Hero 閱讀(2632) 評論(0)  編輯 收藏 引用 所屬分類: 資料整理
             1 #!/usr/bin/env python
             2 #
             3 #       getDirSize.py
             4 #       
             5 #       Copyright 2009 Hiro <wangzhaoren@gmail.com>
             6 #       
             7 #       This program is free software; you can redistribute it and/or modify
             8 #       it under the terms of the GNU General Public License as published by
             9 #       the Free Software Foundation; either version 2 of the License, or
            10 #       (at your option) any later version.
            11 #       
            12 #       This program is distributed in the hope that it will be useful,
            13 #       but WITHOUT ANY WARRANTY; without even the implied warranty of
            14 #       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            15 #       GNU General Public License for more details.
            16 #       
            17 #       You should have received a copy of the GNU General Public License
            18 #       along with this program; if not, write to the Free Software
            19 #       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
            20 #       MA 02110-1301, USA.
            21 
            22 import os
            23 from os.path import join, getsize
            24 
            25 def getDirSize( dir ):
            26     size = 0L
            27     for root, dirs, files in os.walk(dir):
            28         size += sum( [getsize(join(root, name)) for name in files] )
            29     return size
            30 
            31 def main():
            32     
            33     filesize = getDirSize( "/home/wangzr" )
            34     print ( "there are %0.3f" %(filesize/1024/1024), "Mb in /home/wangzr" )
            35         
            36     return 0
            37 
            38 if __name__ == '__main__': main()
            39 

            7777久久久国产精品消防器材| 国产精品99精品久久免费| 久久久精品久久久久影院| 伊人情人综合成人久久网小说| 国产99久久久国产精品~~牛| 精品久久久久久无码专区不卡| 香蕉久久av一区二区三区| 韩国三级大全久久网站| 国产亚洲精午夜久久久久久| 久久精品亚洲福利| 久久精品麻豆日日躁夜夜躁| 久久久精品久久久久久 | 国产精品对白刺激久久久| 国产精品一区二区久久| 性高朝久久久久久久久久| 国产美女久久精品香蕉69| 久久久久99精品成人片三人毛片| 麻豆亚洲AV永久无码精品久久| 91精品国产综合久久四虎久久无码一级 | 久久福利青草精品资源站| 久久久噜噜噜久久中文字幕色伊伊| 久久精品国产男包| 国产综合精品久久亚洲| 97r久久精品国产99国产精| 亚洲国产美女精品久久久久∴| 久久综合欧美成人| 久久久无码一区二区三区| 久久人人爽人人爽人人片AV高清| 国产一区二区三精品久久久无广告 | 色综合久久最新中文字幕| 思思久久99热只有频精品66| 成人国内精品久久久久一区| 国产A级毛片久久久精品毛片| 狠狠色丁香久久婷婷综合蜜芽五月| 久久青青草原综合伊人| AAA级久久久精品无码片| 伊人久久综合精品无码AV专区| 性色欲网站人妻丰满中文久久不卡| 久久久网中文字幕| 久久影院久久香蕉国产线看观看| 国产精品久久久久天天影视|