• <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獲取文件夾大小(2)

            Posted on 2009-07-28 14:07 Hero 閱讀(453) 評論(0)  編輯 收藏 引用 所屬分類: 資料整理
             1 #!/usr/bin/env python
             2 #
             3 #       getDirSize2.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 
            23 import os
            24 #from os import listdir
            25 
            26 def getDirSize( source ) :
            27     size = 0L
            28     if os.path.isfile( source ) :
            29         size += os.stat( source )[6]
            30     elif os.path.isdir( source ) :
            31         for src in os.listdir( source ) :
            32             srcpath = os.path.join( source, src )
            33             print srcpath
            34             size += getDirSize( srcpath )
            35     
            36     return size
            37     
            38 def main():
            39     
            40     dirname = r"/home/wangzr"
            41     print getDirSize( dirname ) / 1024 /1024
            42     return 0
            43 
            44 if __name__ == '__main__': main()
            45 

            久久永久免费人妻精品下载| 怡红院日本一道日本久久| 国产精品久久一区二区三区| 久久99国产精品尤物| 2020最新久久久视精品爱| 久久久久国产精品三级网| 亚洲日本va午夜中文字幕久久| 婷婷综合久久中文字幕蜜桃三电影| A狠狠久久蜜臀婷色中文网| 久久久久97国产精华液好用吗| 亚洲国产精品18久久久久久| 久久精品免费网站网| 精品蜜臀久久久久99网站| 综合久久给合久久狠狠狠97色| 99精品久久精品一区二区| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 国产精品青草久久久久婷婷| 日韩中文久久| 91精品国产色综久久| 国产精品美女久久久久久2018| 亚洲欧美国产精品专区久久| 99久久www免费人成精品| 久久精品国产久精国产思思| 久久精品国产99国产精品亚洲 | 久久午夜伦鲁片免费无码| 久久久国产精品| 国产精品九九久久免费视频 | 99久久久精品| 国内精品伊人久久久久AV影院| 人妻无码精品久久亚瑟影视| 久久久久久亚洲精品不卡| 99久久久久| 久久国产成人| 久久久久一级精品亚洲国产成人综合AV区| 久久精品国产亚洲AV香蕉| 久久婷婷五月综合国产尤物app| 久久精品卫校国产小美女| 欧洲人妻丰满av无码久久不卡 | 久久久精品波多野结衣| 国産精品久久久久久久| 精品久久久久久国产免费了|