Python讀寫txt文本文件

  Python讀寫txt文本文件 一、文件的打開和創建 1 2 3 4 5 >>> f = open('/tmp/test.txt') >>> f.read() 'hello python!\nhello world!\n' >>> f <open file '/tmp/test.txt', mode 'r' at 0x7fb2255efc00>   二、文件的讀取 步驟:打開 -- 讀取 --
相關文章
相關標籤/搜索