![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
进击的夸克
不想再佛系的青年
展开
-
读取xml文件指定内容
def read_xml(path, tag_name='QW', attribute_name='value'): dom_tree = xml_parse(path) root_node = dom_tree.documentElement tag_list = root_node.getElementsByTagName(tag_name) details =...原创 2020-03-23 22:56:32 · 331 阅读 · 0 评论 -
PYNLPIR中文分词,生成词云图片
from collections import Counterimport matplotlib.pyplot as pltimport wordcloudimport pynlpirwith open('./paper.txt', encoding='utf-8') as text: contents = text.read()# 分词pynlpir.open() ...原创 2020-03-22 21:52:52 · 542 阅读 · 0 评论 -
Python 递归读取某文件夹下全部指定后缀名文件
import osdef all_files(path, file_type): # 生成path路径下全部file_type类型文件绝对路径列表 f_list = [] def files_list(father_path): sub_path = os.listdir(father_path) # 读取父路径下全部文件或文件夹名称 ...原创 2020-03-22 21:24:34 · 909 阅读 · 0 评论