• <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 
            综合网日日天干夜夜久久| 成人免费网站久久久| 久久久久国产| 老男人久久青草av高清| 奇米综合四色77777久久| 精品久久香蕉国产线看观看亚洲| 99久久精品九九亚洲精品| 免费精品久久天干天干| 91精品国产91久久久久久青草 | 久久综合综合久久狠狠狠97色88| 久久中文娱乐网| 亚洲va久久久噜噜噜久久狠狠| A级毛片无码久久精品免费| 久久人做人爽一区二区三区 | 久久亚洲国产精品五月天婷| 精品综合久久久久久98| 久久精品三级视频| 无码国产69精品久久久久网站| 久久精品国产色蜜蜜麻豆 | 久久久99精品一区二区| 久久久久久亚洲Av无码精品专口| 久久一区二区三区免费| 亚洲国产精品热久久| 99久久777色| 国产精品一区二区久久国产| 天天综合久久一二三区| 久久久久人妻一区精品 | 久久精品青青草原伊人| 色婷婷噜噜久久国产精品12p| 91久久成人免费| 久久夜色tv网站| 国产成人综合久久久久久| 91精品国产综合久久精品| 99久久精品午夜一区二区| 青草国产精品久久久久久| 国产亚洲精品自在久久| 久久精品黄AA片一区二区三区 | 久久亚洲中文字幕精品一区四| 99久久精品国产一区二区| 很黄很污的网站久久mimi色| 久久精品女人天堂AV麻|