Python
文章平均质量分 69
ethan_sui
这个作者很懒,什么都没留下…
展开
-
python从一堆文件中挑选指定文件(有需挑选的文件列表文档)
通过打开想要挑选的文档,然后另存为from PIL import Imageimport os.pathFileList = "你的目录/test.txt" #包含需要挑选文件路径的文档 with open(FileList) as f: for i in f.readlines(): i = i.strip("\n") x1,x2 = o...原创 2020-05-04 14:41:06 · 1788 阅读 · 0 评论 -
(实用!)如何从一堆文本中查找指定内容,并输出其位置
不多讲,直接代码from glob import globfind_want = "你想查找的内容"FileList = glob(r"你的目录/*.txt")for File in FileList: with open(File) as f: for index, line in enumerate(f.readlines()): ...原创 2020-05-01 21:46:14 · 1487 阅读 · 0 评论 -
利用python的matplotlib模块作图
Matplotlib是Python的绘图库,在日常工作和科研活动中经常需要用到,本博文会不定期更新一些常见的画图实例。一、画散点图 给出一些点坐标,在二维坐标系上表示出来import matplotlib.pyplot as plt #pyplot子模块提供了一系列API帮助画图x = [2, 5, 8, 10, 14, 17, 22, 24, 27] #提供一...原创 2020-03-31 20:30:34 · 11540 阅读 · 0 评论