• <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>

            我希望你是我獨(dú)家記憶

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

            python獲取文件夾大小(1)

            Posted on 2009-07-28 14:07 Hero 閱讀(2632) 評(píng)論(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 

            国内精品久久久久伊人av| 久久久国产乱子伦精品作者| 国产亚洲欧美成人久久片| 99国产精品久久| 国产一区二区精品久久凹凸| 国产精品久久久久久久久久免费| 国产精品内射久久久久欢欢| 久久综合成人网| 一本一本久久a久久综合精品蜜桃| 亚洲午夜久久久影院| 99久久精品午夜一区二区| 久久精品国产免费| 亚洲AV伊人久久青青草原| 久久夜色精品国产噜噜麻豆| 国产精品综合久久第一页| 欧美亚洲国产精品久久| 日韩人妻无码精品久久免费一| 精品久久久久久无码专区| 久久久久国产| 99热成人精品热久久669| 性做久久久久久久久久久| 精品无码久久久久久午夜| 欧美久久亚洲精品| 精品国产福利久久久| 久久人人爽人人爽人人片av麻烦 | 亚洲综合日韩久久成人AV| 人人狠狠综合久久亚洲婷婷| 久久人妻AV中文字幕| 亚洲国产精品久久66| 久久久免费精品re6| 久久无码中文字幕东京热| 国产精品美女久久久免费| 99久久无码一区人妻a黑| 无码人妻少妇久久中文字幕蜜桃 | 久久99中文字幕久久| 伊人久久精品无码av一区| 久久这里只有精品视频99| 国产精品美女久久久久AV福利| 久久精品国产亚洲一区二区| 久久久久久久人妻无码中文字幕爆 | 狠狠人妻久久久久久综合蜜桃|