创建表importsqlite3# 连接文件数据库(不存在则自动创建)conn=sqlite3.connect("my_database.db")cursor=conn.cursor()# 创建表cursor.execute(""" create table if not exists users ( id integer primary key autoincrement, username text not null, age integer ) """)# 插入数据cursor.execute("insert into users(username, age) values("bob", 25)")conn.commit()# 查询数据cursor.execute("select * from users")print(cursor.fetchall())# 输出: [(1, 'bob', 25)]conn.close()-----------------------------------------------------------------------------------删除表中数据importsqlite3 DB_FILE="C:/inoutsave.db"# 连接到SQLite数据库conn=sqlite3.connect(DB_FILE)try:# 创建一个游标对象cursor=conn.cursor()# 执行DELETE语句清除表数据cursor.execute("DELETE FROM io_record")# 提交事务conn.commit()exceptsqlite3.Errorase:print(f"An error occurred:{e}")# 如果发生错误,则回滚事务conn.rollback()finally:# 关闭数据库连接conn.close()sqlite3简单操作
张小明
前端开发工程师
Qwen3-VL-2B工具集推荐:提升多模态开发效率的插件
Qwen3-VL-2B工具集推荐:提升多模态开发效率的插件 1. 引言 随着人工智能技术向多模态方向演进,视觉语言模型(Vision-Language Model, VLM)正逐步成为智能应用的核心组件。在资源受限或缺乏GPU支持的场景下,如何高效部…
TradingAgents-CN智能交易系统终极指南:从零到精通的全链路实战
TradingAgents-CN智能交易系统终极指南:从零到精通的全链路实战 【免费下载链接】TradingAgents-CN 基于多智能体LLM的中文金融交易框架 - TradingAgents中文增强版 项目地址: https://gitcode.com/GitHub_Trending/tr/TradingAgents-CN 想要构建属于自己的A…
LabelImg终极实战指南:高效图像标注工具从入门到精通
LabelImg终极实战指南:高效图像标注工具从入门到精通 【免费下载链接】labelImg LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Lab…
Windows 11热键冲突排查:OpenArk工具实战指南
Windows 11热键冲突排查:OpenArk工具实战指南 【免费下载链接】OpenArk The Next Generation of Anti-Rookit(ARK) tool for Windows. 项目地址: https://gitcode.com/GitHub_Trending/op/OpenArk 你是否在Windows 11系统中遇到过CtrlC无法复制、WinD无法显示…
OpenCore Legacy Patcher:让老旧Mac重获新生的终极指南
OpenCore Legacy Patcher:让老旧Mac重获新生的终极指南 【免费下载链接】OpenCore-Legacy-Patcher 体验与之前一样的macOS 项目地址: https://gitcode.com/GitHub_Trending/op/OpenCore-Legacy-Patcher 还在为苹果官方停止支持老旧Mac设备而烦恼吗࿱…
TrackWeight深度解析:Force Touch传感器的终极称重指南
TrackWeight深度解析:Force Touch传感器的终极称重指南 【免费下载链接】TrackWeight Use your Mac trackpad as a weighing scale 项目地址: https://gitcode.com/gh_mirrors/tr/TrackWeight 你是否想过,日常使用的MacBook触控板竟然能变身高精度…