天宫鹤

上一页 1 2 3 4 5 6 ··· 9 下一页

2024年7月6日

Python以中心裁剪图片,一个中国大陆身份证的尺寸是88mm*55mm,通常使用的身份证像素分辨率是336*256

摘要: 1 # 以中心裁剪图片 2 # 一个中国大陆身份证的尺寸是88mm*55mm,通常使用的身份证像素分辨率是336*256 3 def crop_image_by_center(input_image_path, width_mm=88, height_mm=55): 4 # 打开图片 5 image 阅读全文

posted @ 2024-07-06 17:13 GoGrid 阅读(1) 评论(0) 推荐(0) 编辑

Python按身份证实际大小调整图片尺寸

摘要: # 按身份证实际大小调整图片尺寸 def resize_image_by_id(image, width_mm=86, height_mm=55): # 四周裁掉5mm # image = crop_image_by_border(image, 5, 5, 5, 5) # 四周裁掉5mm # 计算新 阅读全文

posted @ 2024-07-06 17:09 GoGrid 阅读(3) 评论(0) 推荐(0) 编辑

Python按证件照实际大小调整图片尺寸,2英寸证件照:35mmx49mm

摘要: # 按证件照实际大小调整图片尺寸,2英寸证件照:35mmx49mm(2024年7月6日) def resize_image_by_ip(input_image_path, width_mm=35, height_mm=49): input_image_path = Path(input_image_ 阅读全文

posted @ 2024-07-06 17:05 GoGrid 阅读(1) 评论(0) 推荐(0) 编辑

2024年7月2日

转发:Python_关于使用【zipfile】解压路径中文乱码问题-直接修改【zipfile.py】源码 —— 简单粗暴且有效

摘要: 参考网址:https://blog.csdn.net/weixin_45681435/article/details/133276120 阅读全文

posted @ 2024-07-02 17:47 GoGrid 阅读(2) 评论(0) 推荐(0) 编辑

2024年6月21日

Python win32com读写Word文档中的表格单元格

摘要: # 读Word表格单元格def read_cell(_table, _row, _column): _w_cells = _table.Cell(_row, _column) return _w_cells.Range.Text[:-2]# 写Word表格单元格def write_cell(_tab 阅读全文

posted @ 2024-06-21 15:56 GoGrid 阅读(3) 评论(0) 推荐(0) 编辑

2024年5月31日

Python-pptx正确设置中文字体

摘要: 使用pptx_ea_font库设置中文字体: 1.安装pptx_ea_font库:pip install pptx-ea-font 2.p = text_frame.paragraphs[0] # 取文本段落 run = p.runs[0] # 取文本运行对象,该对象为段落的子元素 pptx_ea_ 阅读全文

posted @ 2024-05-31 20:03 GoGrid 阅读(68) 评论(0) 推荐(0) 编辑

2024年5月5日

python-pptx删除幻灯片

摘要: # 删除多余幻灯片del prs.slides._sldIdLst[起始:结束] # 删除幻灯片 阅读全文

posted @ 2024-05-05 07:31 GoGrid 阅读(37) 评论(0) 推荐(0) 编辑

2024年4月13日

Python自动化办公应用大全(下册)12.8导出PPT为长图运行报异常这样解决!!!

摘要: 原程序会报异常: 解决办法: 将第12语句:prs.SaveAs(img_fold, 17) 修改为:prs.SaveAs(img_fold.parent.joinpath('png.jpg')) 原因:问题解决了,但不明白所以然!!! 阅读全文

posted @ 2024-04-13 12:38 GoGrid 阅读(4) 评论(0) 推荐(0) 编辑

2024年4月12日

《Python之禅》——原文和翻译

摘要: 《Python之禅》 优美胜于丑陋,明了胜于晦涩。简单胜于复杂,复杂胜于凌乱。扁平胜于嵌套,间隔胜于紧凑。可读性很重要!即使实用比纯粹更优,特例亦不可违背原则。错误绝不能悄悄忽略,除非它明确需要如此。面对不确定性,拒绝妄加猜测。任何问题应有一种,且最好只有一种,显而易见的解决方法。虽然这并不容易,因 阅读全文

posted @ 2024-04-12 22:04 GoGrid 阅读(132) 评论(0) 推荐(0) 编辑

AttributeError: 'DataFrame' object has no attribute 'iteritems'. Did you mean: 'isetitem'?解决办法!!!

摘要: 在使用Python Pandas的DataFrame时,报异常: 语句:for col, data in data_list[i].iteritems(): 异常:AttributeError: 'DataFrame' object has no attribute 'iteritems'. Did 阅读全文

posted @ 2024-04-12 18:42 GoGrid 阅读(115) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 9 下一页

导航