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

            欧美精品丝袜久久久中文字幕| 亚洲а∨天堂久久精品9966| 亚洲精品高清一二区久久| 99久久人人爽亚洲精品美女 | 国产成人精品久久二区二区| 99蜜桃臀久久久欧美精品网站| 久久国语露脸国产精品电影| 囯产极品美女高潮无套久久久| 午夜精品久久久久久中宇| 久久91亚洲人成电影网站| 久久93精品国产91久久综合| 香蕉久久久久久狠狠色| 狠狠狠色丁香婷婷综合久久五月| 伊人久久精品影院| 久久久噜噜噜久久中文福利| 久久久久国产一级毛片高清版| 日韩亚洲国产综合久久久| 狼狼综合久久久久综合网| 国产免费久久久久久无码| 亚洲国产另类久久久精品小说| 国产69精品久久久久9999| 中文字幕久久久久人妻| 欧美久久精品一级c片片| 久久久久久精品无码人妻| 国产福利电影一区二区三区久久久久成人精品综合 | 久久精品视频免费| 精产国品久久一二三产区区别| 亚洲一区中文字幕久久| 色婷婷综合久久久久中文一区二区| 国产精品欧美亚洲韩国日本久久| 伊人久久综合成人网| 久久精品国产精品亜洲毛片| .精品久久久麻豆国产精品| 中文精品久久久久人妻不卡| 久久亚洲国产精品成人AV秋霞 | 久久人人爽人人爽人人片AV不 | 久久久久亚洲AV无码去区首| 51久久夜色精品国产| 免费观看久久精彩视频| 精品国产福利久久久| 2021久久国自产拍精品|