摘要: from exts import mail # 邮箱模块化 flask-emailmail.init_app(app) 阅读全文
posted @ 2025-01-23 23:09 我爱你的 阅读(7) 评论(0) 推荐(0)
摘要: Python数据验证库 https://docs.pydantic.org.cn/latest/ 阅读全文
posted @ 2025-01-23 04:35 我爱你的 阅读(14) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- import scrapy class PostSpider(scrapy.Spider): name = 'post' # allowed_domains = ['www.xxx.com'] start_urls = ['https://fanyi. 阅读全文
posted @ 2025-01-23 00:11 我爱你的 阅读(13) 评论(0) 推荐(0)
摘要: scrapy-fingerprint 是 Scrapy 的一个扩展库,旨在为每个请求生成唯一的指纹,以便于管理和避免重复抓取。以下是该库的详细介绍,包括其功能、安装、配置以及用法示例。 功能 唯一性:为每个请求生成独特的指纹,帮助识别和管理爬虫中的请求。 避免重复:通过指纹机制,可以避免对相同 UR 阅读全文
posted @ 2025-01-18 05:45 我爱你的 阅读(145) 评论(0) 推荐(0)
摘要: 1 #导出单项目所需库 最后生成 requirements.txtpip install pipreqspipreqs . 如果用的是虚拟环境请用下面的方法导出所需要的包 pip freeze > requirements.txt 2#虚拟环境 创建虚拟环境 去到指定目录下运行 'python -m 阅读全文
posted @ 2025-01-17 18:05 我爱你的 阅读(70) 评论(0) 推荐(0)
摘要: -- 先创建表后关联外键-- ALTER TABLE <数据表名> ADD CONSTRAINT <外键名>-- FOREIGN KEY(<列名>) REFERENCES <主表名> (<列名>); alter table info add constraint fk_info_depart for 阅读全文
posted @ 2025-01-10 22:26 我爱你的 阅读(49) 评论(0) 推荐(0)
摘要: `` Document 2222222222222222222222222222222222223333333333333333333333333333333333333大奇偶奇偶按大沙发阿道夫萨达d是啊发收到发到打法是否付顺丰大奇偶奇偶按大沙发阿道夫萨达d是啊发收到发到打法是否付顺丰的发到付阿道夫 阅读全文
posted @ 2025-01-09 02:21 我爱你的 阅读(7) 评论(0) 推荐(0)
摘要: import pymysql def main(): _0 = [ {'category_id': '20', 'category': '动漫专区', 'pictype': 0}, {'category_id': '12', 'category': '日本', 'pictype': 0}, {'ca 阅读全文
posted @ 2025-01-08 22:56 我爱你的 阅读(8) 评论(0) 推荐(0)
摘要: 使用 autoload = True 还有一种方法可以让模型代码跟数据库表字段关联起来,__table__ 中使用 autoload = True 它会自动加载 model 的 Column, 使用这种方法时,在构建 model 之前,Base 类要与 engine 进行绑定. 代码语言:javas 阅读全文
posted @ 2025-01-04 07:27 我爱你的 阅读(80) 评论(0) 推荐(0)
摘要: 这里推荐一个小库 objtyping:对任意实例对象(不需要是dataclass,也无需任何其他装饰),都可以转换为基础类型的dict、list,或者 dict-list 嵌套结构,支持多级嵌套。 首先安装依赖:pip install objtyping 于是上面的Student对象,就可以这样转换 阅读全文
posted @ 2025-01-02 20:50 我爱你的 阅读(48) 评论(0) 推荐(0)