python學習(1)txt文件讀寫

經常使用的python讀寫模式 讀取txt文件 讀取txt文件(文件存在) def read_txt(self, path): """讀取txt文本""" with open(path, 'r') as f: r = f.readlines() print('輸出readlines結果', r) 運行結果爲:pyth
相關文章
相關標籤/搜索