• <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 閱讀(655) 評論(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 
            久久国产香蕉一区精品| 久久免费小视频| 亚洲色欲久久久久综合网| 亚洲乱码日产精品a级毛片久久| 色婷婷久久综合中文久久一本| 久久这里都是精品| 久久久久亚洲av无码专区导航 | 久久久久久久国产免费看| 精品久久久久久无码免费| 无码人妻久久一区二区三区蜜桃| 亚洲精品国产字幕久久不卡| 亚洲欧美精品伊人久久| 亚洲精品乱码久久久久久蜜桃不卡| 久久精品免费观看| 久久亚洲AV无码精品色午夜麻豆| 久久香蕉一级毛片| 亚洲∧v久久久无码精品| 久久激情亚洲精品无码?V| 人妻精品久久无码区| 亚洲Av无码国产情品久久| 久久99精品国产| 国产精品免费福利久久| 四虎国产精品成人免费久久| 国内精品久久久久久久影视麻豆 | 欧美成a人片免费看久久| 婷婷五月深深久久精品| 久久无码AV一区二区三区| 久久久精品久久久久久| 91久久九九无码成人网站| 777米奇久久最新地址| 亚洲国产另类久久久精品小说 | 狠狠色丁香久久婷婷综| 午夜精品久久久久久中宇| 伊人久久大香线蕉综合Av| 久久黄视频| 久久久这里只有精品加勒比| 久久久久久国产精品美女| 欧美激情精品久久久久久| 久久久久婷婷| 97久久婷婷五月综合色d啪蜜芽| 久久经典免费视频|