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")





posted @ 2019-02-08 09:48  玉米帮  阅读(1195)  评论(0编辑  收藏  举报