本文共 312 字,大约阅读时间需要 1 分钟。
1 import sqlite3 2 3 def init_db(): 4 sql = 'create table user(id INT,name TEXT)' 5 conn = sqlite3.connect("test.db") 6 cursor = conn.cursor() 7 cursor.execute(sql) 8 conn.commit() 9 cursor.close()10 conn.close()11 12 if __name__=='__main__':13 init_db()
同一目錄生成test.db
使用DB SQL打開
转载地址:http://pmhym.baihongyu.com/