python在sqlite动态创建表源码

代码之余,将开发过程中经常用的代码片段备份一下,如下的代码是关于python在sqlite动态创建表的代码,应该能对各位有所用。

import sqlite3 as db

conn = db.connect('mytest.db')
cursor = conn.cursor()
cursor.execute("create table person(name text, age text, address text)")
print("table created")





猜你喜欢

转载自www.cnblogs.com/yumiban/p/10355900.html