摘要: 1、创建excel、excel单元格操作(读、写)、删除excel工作薄 import openpyxl ''' openpyxl读取excel工作表 ''' if __name__ == '__main__': '''load_workbook()获取工作簿对象''' file_1 = openp 阅读全文
posted @ 2021-10-29 20:40 七彩蜗牛 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1、通过PyInstaller库实现; pip install pyinstaller # 在terminal终端中执行命令 pyinstaller 词云生成.py pyinstaller -F 词云生成.py #python源文件生成一个独立的可执行文件。 2、指定打包程序使用的图标 ,格式只能为 阅读全文
posted @ 2021-10-29 19:28 七彩蜗牛 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1、使用wordcloud库生成词云图 import wordcloud import jieba # from scipy.misc import imread #新版本已经没有imread接口,使用下面的命令导入 from matplotlib.pyplot import imread ''' 阅读全文
posted @ 2021-10-29 17:40 七彩蜗牛 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 1、提取PDF的某些页:通过PyPDF2库实现;pip install PyPDF2 import PyPDF2 ''' 提取PDF的某些页 1、将目标文件读取至python内存,以二进制方式读取; 2、创建一个写对象,将需要提取的PDF文件赋值到写对象; 3、将写对象的变量导出,并储存为PDF文件 阅读全文
posted @ 2021-10-29 14:39 七彩蜗牛 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 1、字符串转换 TEST to test:将字符串涉及‘T’,‘E’,‘S’,‘T’的字符全部转换为小写 msg = ''' Hello It's A TEST Program I love Testing Hhh, this is a Test ''' msg = msg.strip('\n') 阅读全文
posted @ 2021-10-29 10:03 七彩蜗牛 阅读(23) 评论(0) 推荐(0) 编辑