• <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-23 16:29 Hero 閱讀(659) 評論(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 
            亚洲伊人久久综合中文成人网| 97久久精品无码一区二区天美| 精品欧美一区二区三区久久久| 色综合久久最新中文字幕| 久久久久久A亚洲欧洲AV冫| 亚洲一级Av无码毛片久久精品| 麻豆AV一区二区三区久久| 四虎国产精品免费久久久| 最新久久免费视频| 欧美亚洲另类久久综合| 国产精品亚洲综合久久| 久久精品国产一区二区三区日韩| 亚洲国产高清精品线久久 | 久久天天躁狠狠躁夜夜2020老熟妇| 亚洲精品乱码久久久久久蜜桃| 天天躁日日躁狠狠久久| 久久久久综合中文字幕| 精品久久久久久久| 国产欧美久久久精品影院| 国产免费久久精品99久久| 人妻精品久久久久中文字幕69 | 久久高潮一级毛片免费| 久久婷婷成人综合色综合| 亚洲伊人久久综合中文成人网| 久久国产精品-久久精品| 久久精品a亚洲国产v高清不卡| 久久精品国产亚洲AV香蕉| 色99久久久久高潮综合影院| 热99re久久国超精品首页| 精品久久无码中文字幕| 无码人妻久久一区二区三区免费| 中文字幕精品久久久久人妻| 久久久噜噜噜久久| 久久无码国产| 国产精品伊人久久伊人电影| 国产69精品久久久久99尤物| 9999国产精品欧美久久久久久| 91久久成人免费| 欧美日韩精品久久久久| 欧美伊人久久大香线蕉综合69| 亚洲精品无码久久毛片|