• <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 
            欧洲国产伦久久久久久久| 国产成人久久精品麻豆一区| 欧美日韩精品久久久久| 人妻少妇精品久久| 亚洲AV无码久久精品色欲| 久久久av波多野一区二区| 色偷偷久久一区二区三区| 九九久久99综合一区二区| 青青草原综合久久| 久久伊人精品青青草原日本| 久久天天躁狠狠躁夜夜2020| 久久久午夜精品福利内容| 久久精品中文无码资源站| 久久精品国产只有精品66| 日韩久久久久久中文人妻| 精品国产青草久久久久福利 | 久久精品国产第一区二区三区| 99久久精品午夜一区二区| 久久免费99精品国产自在现线| 久久99国产综合精品| 欧美大战日韩91综合一区婷婷久久青草| 久久久久久久亚洲Av无码| 无码8090精品久久一区| 久久香蕉综合色一综合色88| 少妇高潮惨叫久久久久久| 四虎影视久久久免费| 久久精品国产91久久麻豆自制 | 免费精品久久久久久中文字幕 | 无码人妻久久久一区二区三区 | 久久中文字幕无码专区| 69久久精品无码一区二区| 亚洲AV无码久久精品蜜桃| 2021国内久久精品| 午夜精品久久久久久影视777| 国产精品免费福利久久| 久久这里有精品视频| 色偷偷888欧美精品久久久| 精品久久久久久亚洲精品 | 伊人伊成久久人综合网777| 品成人欧美大片久久国产欧美| 四虎国产精品免费久久5151|