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

            我希望你是我獨家記憶

            一段永遠封存的記憶,隨風(fēng)而去
            posts - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            Python 打開文件

            Posted on 2009-07-23 16:29 Hero 閱讀(660) 評論(0)  編輯 收藏 引用 所屬分類: C#積累
             1 #!/usr/bin/env python
             2 #
             3 #       file.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 
            24 def main():
            25     
            26     import sys    
            27     
            28     def readfile( filename ): 
            29         """print a file to the standard output."""
            30         
            31         f = file( filename )
            32         while True :
            33             line = f.readline()
            34             if( len(line) == 0 ) : break 
            35             
            36             print line, 
            37         f.close() ;
            38     
            39     #script starts from here 
            40     if len( sys.argv ) < 2 :
            41         print "No action specified."
            42         sys.exit()
            43         
            44     if sys.argv[1].startswith( '--' ) :
            45         
            46         option = sys.argv[1][2:]
            47         if option == 'version' : print "version 1.2"
            48         elif option == 'help' : print '''
            49         --version :    
            50         --help    :'''
            51         else :
            52             print "unknown option."
            53             
            54         sys.exit() 
            55     
            56     else :
            57         for filename in sys.argv[1:]:
            58             readfile( filename )
            59             
            60     return 0
            61 
            62 if __name__ == '__main__': main()
            63 
            久久国产精品国产自线拍免费| 亚洲中文久久精品无码| 精品久久久久久国产三级| 久久久久久久亚洲精品| 亚洲午夜无码久久久久| 国产2021久久精品| 亚洲AV无一区二区三区久久 | 亚洲精品国产第一综合99久久| 伊人久久大香线蕉综合Av| 91精品无码久久久久久五月天| 亚洲性久久久影院| 久久综合狠狠综合久久激情 | 色播久久人人爽人人爽人人片aV | 一本久久精品一区二区| 精品久久久久久久无码| 欧美日韩精品久久久免费观看| 伊人热人久久中文字幕| 久久棈精品久久久久久噜噜| 久久久精品久久久久久| 国产精品美女久久久| 久久精品卫校国产小美女| 一个色综合久久| 开心久久婷婷综合中文字幕| 国产麻豆精品久久一二三| …久久精品99久久香蕉国产| 99久久国产精品免费一区二区 | 97久久精品人人澡人人爽| 亚洲中文字幕无码久久综合网 | 高清免费久久午夜精品| 久久夜色精品国产噜噜噜亚洲AV| 99久久99久久精品国产片| 久久久久久午夜成人影院| 国产亚洲精久久久久久无码77777| 久久青青草原精品国产软件| 久久精品无码免费不卡| 91秦先生久久久久久久| 中文字幕久久欲求不满| 91秦先生久久久久久久| 久久一本综合| 久久综合久久美利坚合众国| 亚洲香蕉网久久综合影视|