随笔分类 - python
摘要:encoding="utf-8" #文件内容: #11111,ssss,eee,哈哈哈电话,hhh #11111,ssss,eee,哈哈哈电话,hhh #11111,ssss,eee,哈哈哈电话,hhhh # 打开输入文件 encoding="utf-8" 解决中文乱码 with open('D:\
阅读全文
摘要:#输入王小明,输出王 小明 #读取原始txt文件 with open('D:\\PCCW_Test_Script\\111.txt', encoding='utf-8') as file1: content = file1.readlines() # print(content) with open
阅读全文
摘要:import os #返回一个列表 ['01.xlsx', 'EE_reg.txt', 'EE Data.txt', 'ER ENR.txt', 'ER-25.txt'] file_names = os.listdir('D:\\yuyu\\test_yuyu\\accessibility_1\\A
阅读全文
摘要:> 22.txt < 111,aaa 222,bbb 222,bbb > 33.txt < 111,aaa 333,bbb #取交集 intersection def compare_txt_inter(file1,file2): with open(file1,"r") as file1, ope
阅读全文