Python讀取txt文件,用openpyxl模塊寫入到excel

Python讀取txt文件,用openpyxl模塊寫入到excel import openpyxl contents=[] def read_txt(): file_txt=open(r’D:\pycharm\APP\3.txt’,‘r’,encoding=‘utf-8’)#打開txt文件 for i in file_txt: contents.append(i.split())#遍歷txt文件內
相關文章
相關標籤/搜索