摘要: # filname 需要修改的文件名# old 需要替换的字符串# new 替换后的新字符串import os def modify_t(filename,old,new): with open(filename,mode='r',encoding='utf-8') as f ,\ open('%s 阅读全文
posted @ 2020-08-17 23:32 匿名好友 阅读(205) 评论(0) 推荐(0) 编辑
摘要: def count_word(filename): word_dic = {} num = 1 with open(filename,mode='r',encoding='utf-8') as f: word_str = ''.join(f.read()) #用空把所有的单词拼接起来 word_ls 阅读全文
posted @ 2020-08-17 23:10 匿名好友 阅读(269) 评论(0) 推荐(0) 编辑