09 2020 档案

摘要:这个小知识来自公众号【python小屋】 问题描述: 给定一个PDF文件,对其进行任意切分,提取其中任意页面,保存为新的PDF文件。 准备工作: 安装扩展库PyPDF2,参考命令 pip install PyPDF2 参考代码: from PyPDF2 import PdfFileReader, P 阅读全文
posted @ 2020-09-27 09:48 流年中渲染了微笑 阅读(929) 评论(0) 推荐(0) 编辑
摘要:from PIL import Image def cut_image(image): width, height = image.size item_width = width / 3.0 item_height = height / 3.0 box_list = [] for row in ra 阅读全文
posted @ 2020-09-16 13:46 流年中渲染了微笑 阅读(227) 评论(0) 推荐(0) 编辑
摘要:基础版 n = 3 while n > 0: username = input('请输入用户名') pwd = input('请输入密码') if username == 'xiaoqiang' and pwd == '123': print('登陆成功') break else: print('登 阅读全文
posted @ 2020-09-15 14:35 流年中渲染了微笑 阅读(94) 评论(0) 推荐(0) 编辑
摘要:python manage.py inspectdb > models.py 阅读全文
posted @ 2020-09-15 14:34 流年中渲染了微笑 阅读(179) 评论(0) 推荐(0) 编辑
摘要:from collections import defaultdict # 将列表内的元素,根据位数合并成字典 lst = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 32769, 65536, 4294967296] dic = defaultdic 阅读全文
posted @ 2020-09-15 14:33 流年中渲染了微笑 阅读(115) 评论(0) 推荐(0) 编辑
摘要:有时候我在工作当中需要将代码中的注释去掉 下面我们就介绍一下吧 利用python去掉java中的注释 import com.example.pojo.MethodInfo; public class MethodInfoUtil{ private static boolean quoteFlag = 阅读全文
posted @ 2020-09-15 14:32 流年中渲染了微笑 阅读(718) 评论(0) 推荐(0) 编辑
摘要:l = [[ {"id": 1, "key": 255}, {"id": 2, "key": 255}, {"id": 3, "key": 256}, {"id": 4, "key": 256}, {"id": 4, "key": 256}, ]] def getResult_1(l): res = 阅读全文
posted @ 2020-09-15 09:10 流年中渲染了微笑 阅读(1462) 评论(0) 推荐(0) 编辑
摘要:data_list = [{"a": "123", "b": "321"}, {"a": "123", "b": "321"}, {"b": "321", "a": "23"}] seen = set() new_l = [] for d in data_list: t = tuple(d.item 阅读全文
posted @ 2020-09-15 08:57 流年中渲染了微笑 阅读(652) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示