• <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獲取文件夾大?。?)

            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| 色88久久久久高潮综合影院| 免费精品久久天干天干| 久久久久久久人妻无码中文字幕爆| 久久久网中文字幕| 久久久无码人妻精品无码| 精品无码久久久久久午夜| 国内精品免费久久影院| 久久精品国产男包| 久久精品国产国产精品四凭| 色偷偷88888欧美精品久久久| 91精品国产91久久久久久| 欧美一级久久久久久久大| 久久综合九色综合网站| 亚洲国产精品嫩草影院久久| 99久久99久久精品免费看蜜桃 | 国产亚洲精午夜久久久久久| 欧美亚洲国产精品久久高清| 欧美午夜精品久久久久久浪潮| 精品熟女少妇av免费久久| 久久精品国产亚洲AV嫖农村妇女| 18禁黄久久久AAA片| 久久久久青草线蕉综合超碰| 国产精品成人精品久久久 | 久久国产成人亚洲精品影院| 伊人精品久久久久7777| 久久国产乱子伦精品免费强| 久久国产亚洲精品麻豆| 91精品婷婷国产综合久久| 丁香久久婷婷国产午夜视频| 品成人欧美大片久久国产欧美...| 亚洲一区中文字幕久久| 久久免费线看线看| 无码精品久久一区二区三区| 久久久亚洲欧洲日产国码是AV| 中文字幕久久久久人妻| 久久久久夜夜夜精品国产| 久久人人爽人人爽人人片AV高清| 亚洲AV日韩精品久久久久久| 女同久久| 中文国产成人精品久久不卡|