Python讀寫txt文本文件的操做方法全解析

這篇文章主要介紹了Python讀寫txt文本文件的操做方法全解析,包括對文本的查找和替換等技巧的講解,須要的朋友能夠參考下 1、文件的打開和建立node ? 1 2 3 4 5 >>> f = open ( '/tmp/test.txt' ) >>> f.read() 'hello python!\nhello world!\n' >>> f < open file '/tmp/test.txt'
相關文章
相關標籤/搜索