• <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 閱讀(2641) 評論(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 

            97视频久久久| 久久九九亚洲精品| 99久久精品费精品国产一区二区 | 久久精品视频网| 久久久国产乱子伦精品作者| 日韩精品久久久久久免费| 97久久超碰国产精品2021| 精品久久香蕉国产线看观看亚洲| 精品久久久久久久无码 | 狠狠色丁香久久综合婷婷| 久久精品国产第一区二区三区 | 热综合一本伊人久久精品| 久久天天日天天操综合伊人av| 久久www免费人成精品香蕉| 久久青青草原精品国产软件| 久久人人爽人人爽人人片AV东京热| 99国产精品久久久久久久成人热| 国产精品gz久久久| 久久精品无码专区免费青青| 国产精品视频久久久| 久久久受www免费人成| 久久精品国产男包| 国产精品久久久久久久久免费| 久久久青草青青国产亚洲免观| 久久香蕉超碰97国产精品| 国产精品美女久久久久AV福利| 99久久这里只精品国产免费| 无遮挡粉嫩小泬久久久久久久 | 久久久中文字幕日本| 久久亚洲精品成人AV| 久久精品无码一区二区三区日韩| 综合人妻久久一区二区精品| 狠狠久久综合| 国产∨亚洲V天堂无码久久久| 久久嫩草影院免费看夜色| 97久久超碰国产精品2021| 国产成人精品综合久久久久| 国产精品久久久久影院嫩草| 人妻无码精品久久亚瑟影视 | 国产69精品久久久久99| 97精品伊人久久久大香线蕉|