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

            久久久无码精品亚洲日韩软件| 国产精品国色综合久久| 久久亚洲av无码精品浪潮| 久久久受www免费人成| 久久亚洲中文字幕精品有坂深雪| 青青久久精品国产免费看| 97久久精品人妻人人搡人人玩| 久久久久中文字幕| 久久精品国产福利国产秒| 国产成人精品综合久久久久| 久久精品毛片免费观看| 精品视频久久久久| 无码国内精品久久人妻| 97精品久久天干天天天按摩| 久久国产成人精品国产成人亚洲| 久久天天躁狠狠躁夜夜avapp| 久久精品亚洲男人的天堂| 亚洲AV日韩AV永久无码久久| 久久精品国产99国产精品澳门 | 四虎久久影院| 国产成人精品久久一区二区三区| 伊人久久大香线焦AV综合影院| 99久久精品国产综合一区| 中文成人久久久久影院免费观看| 模特私拍国产精品久久| 国产精品久久久久乳精品爆| 久久ZYZ资源站无码中文动漫| 亚洲伊人久久综合中文成人网| 亚洲精品午夜国产va久久 | 久久伊人亚洲AV无码网站| 国产成人香蕉久久久久| 欧美色综合久久久久久| 久久久亚洲裙底偷窥综合| 国产精品亚洲综合专区片高清久久久 | 人人狠狠综合久久亚洲88| 久久精品亚洲AV久久久无码| 久久天天躁狠狠躁夜夜av浪潮| 99久久免费国产特黄| 久久精品国产亚洲AV电影| 精品蜜臀久久久久99网站| 青青青国产精品国产精品久久久久|