<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      python基礎31[list+tuple+set+dict+str+file的成員方法]

       

      列出常見類型的方法:


      def ListFunctions(lists):
        
      print ("------------------------------------------")
        
      print (type(lists))
        
      for item in dir(lists):
          
      if ( not item.startswith("__")):
            
      print (item)

      #list
      = [123#or list(1,2,3)
      ListFunctions(l)
      # tuple
      = (123)
      ListFunctions (t)
      #set
      = {123#or set(1,2,3)
      ListFunctions(s)
      #dict
      = {1:'1v'2:'2v'3:'3v'#or dict(1:'1v', 2:'2v', 3:'3v')
      ListFunctions(d)
      #str
      myStr="123" #or str("123")
      ListFunctions(myStr)

      #file
      file = open("test\\file.txt""r")
      ListFunctions(file)

       

       

      運行結果:

      ------------------------------------------
      <class 'list'>
      append
      count
      extend
      index
      insert
      pop
      remove
      reverse
      sort
      ------------------------------------------
      <class 'tuple'>
      count
      index
      ------------------------------------------
      <class 'set'>
      add
      clear
      copy
      difference
      difference_update
      discard
      intersection
      intersection_update
      isdisjoint
      issubset
      issuperset
      pop
      remove
      symmetric_difference
      symmetric_difference_update
      union
      update
      ------------------------------------------
      <class 'dict'>
      clear
      copy
      fromkeys
      get
      items
      keys
      pop
      popitem
      setdefault
      update
      values
      ------------------------------------------
      <class 'str'>
      _formatter_field_name_split
      _formatter_parser
      capitalize
      center
      count
      encode
      endswith
      expandtabs
      find
      format
      index
      isalnum
      isalpha
      isdecimal
      isdigit
      isidentifier
      islower
      isnumeric
      isprintable
      isspace
      istitle
      isupper
      join
      ljust
      lower
      lstrip
      maketrans
      partition
      replace
      rfind
      rindex
      rjust
      rpartition
      rsplit
      rstrip
      split
      splitlines
      startswith
      strip
      swapcase
      title
      translate
      upper
      zfill
      ------------------------------------------
      <class '_io.TextIOWrapper'>
      _CHUNK_SIZE
      _checkClosed
      _checkReadable
      _checkSeekable
      _checkWritable
      buffer
      close
      closed
      detach
      encoding
      errors
      fileno
      flush
      isatty
      line_buffering
      name
      newlines
      read
      readable
      readline
      readlines
      seek
      seekable
      tell
      truncate
      writable
      write
      writelines

       

      注意:

      open()函數返回的file object的類型取決與傳入的mode。當open()使用(w,r,wt,rt)來打開文本文件時,它返回的是io.TextIOBase的子類型,特別地為io.TextIOWrapper。當使用buffering打開binary文件時,他返回的是io.BufferedIOBase的子類型,當為讀時返回為io.BufferedReader,當為寫或增加時返回為io.BufferedWriter,當為讀寫模式時,它返回的是io.BufferedRandom。當buffering沒有指定時,返回的是io.rawiobase,io.fileio的子類型。

       

      完!

      posted @ 2011-01-05 14:20  iTech  閱讀(1727)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲精品久久麻豆蜜桃| 肉大捧一进一出免费视频| 亚洲av永久无码精品漫画| 欧美成人精品| 内射一区二区三区四区| 中文字幕一区二区三区久久蜜桃| 中文字幕日韩人妻一区| 国产av永久无码天堂影院| 开心一区二区三区激情| 国产精品激情av在线播放| 99久久精品国产一区二区暴力| 久久精品国产99国产精品严洲 | 国产乱子影视频上线免费观看| 亚洲av高清一区二区三| 国产激情文学亚洲区综合| 久久婷婷大香萑太香蕉av人| 免费久久人人爽人人爽AV| 久久碰国产一区二区三区| 日韩伦人妻无码| 亚洲欧洲日产国无高清码图片| 久久中文字幕无码一区二区| 午夜福利精品国产二区| 无码人妻av免费一区二区三区| 精品一区二区不卡免费| 国产在线乱子伦一区二区| 国产不卡av一区二区| 99精品国产综合久久久久五月天| 精品黄色av一区二区三区| 亚洲国产成人一区二区在线 | 国产精品无码a∨麻豆| 部精品久久久久久久久| 欧美乱码卡一卡二卡四卡免费| 伊人久在线观看视频| 亚洲中文字幕在线二页| 国产精品午夜福利免费看| 国产成人啪精品视频免费APP| 郎溪县| 亚洲av成人无码天堂| 国产av国片精品一区二区| 欧美一区二区三区激情| 97午夜理论电影影院|