python向sqlite插入数据代码演示
python向sqlite插入数据代码演示,本范例演示了如何创建一个本地sqlite3的数据库,然后插入两条数据。
""" 皮蛋编程(https://www.pidancode.com) 创建日期:2022/3/29 功能描述:python向sqlite插入数据代码演示 """ import sqlite3 as db conn = db.connect('mytest.db') cursor = conn.cursor() cursor.execute('insert into person values("Mani","23","22,2nd cross, ka")') cursor.execute('insert into person values("pidancode","22","5th cross, ka")') conn.close()
相关文章