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

            日韩中文久久| 精品久久久久久成人AV| 欧美粉嫩小泬久久久久久久 | 波多野结衣久久一区二区| 热99RE久久精品这里都是精品免费| 精品久久久久久国产 | 91亚洲国产成人久久精品网址| 亚洲国产精品热久久| 国产一区二区久久久| 久久这里只精品国产99热| 久久频这里精品99香蕉久| 久久99国产精品99久久| 日韩电影久久久被窝网| 国产综合久久久久| 久久久久亚洲AV无码观看| 久久综合中文字幕| 日韩乱码人妻无码中文字幕久久 | 久久久国产视频| 狠狠人妻久久久久久综合蜜桃 | 97久久精品人人澡人人爽| 97久久国产综合精品女不卡| 欧美日韩精品久久久久| 国产精品欧美久久久久天天影视 | 男女久久久国产一区二区三区| 久久久久久久亚洲精品| 国产精品久久久久乳精品爆| 久久99国产综合精品| 热re99久久6国产精品免费| 婷婷国产天堂久久综合五月| 久久精品亚洲男人的天堂| 亚洲午夜久久影院| 国产成人精品久久一区二区三区av | 91视频国产91久久久| 中文字幕久久精品无码| 久久综合亚洲色一区二区三区| 久久综合伊人77777| 久久亚洲国产精品五月天婷| 久久se这里只有精品| 无码乱码观看精品久久| 久久精品桃花综合| 亚洲综合精品香蕉久久网|