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

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

            久久精品aⅴ无码中文字字幕不卡| 99久久亚洲综合精品成人| 日本福利片国产午夜久久| 久久夜色精品国产网站| 一本久久知道综合久久| 日日躁夜夜躁狠狠久久AV| 亚洲av日韩精品久久久久久a | 精品综合久久久久久98| 久久精品综合网| 亚洲中文久久精品无码| 亚洲中文久久精品无码ww16| www久久久天天com| 亚洲国产精品热久久| 久久久综合香蕉尹人综合网| 久久久精品久久久久久| 久久亚洲精品无码aⅴ大香| 少妇久久久久久被弄高潮| 亚洲精品无码久久久| 2021最新久久久视精品爱| 日韩人妻无码精品久久久不卡| 精品亚洲综合久久中文字幕| 久久播电影网| 亚洲欧美成人综合久久久| 婷婷综合久久狠狠色99h| 久久亚洲电影| 久久国产色AV免费观看| 国产L精品国产亚洲区久久 | 亚洲精品成人网久久久久久| 久久香综合精品久久伊人| 国产成人精品久久一区二区三区| 精品多毛少妇人妻AV免费久久| 久久人妻AV中文字幕| 色综合久久综精品| 久久久久久久波多野结衣高潮| 久久久久AV综合网成人 | 青青草国产精品久久| 久久一区二区三区免费| 91久久婷婷国产综合精品青草| 人妻少妇精品久久| 成人精品一区二区久久| 欧美黑人激情性久久|