python實(shí)現(xiàn)在sqlite動態(tài)創(chuàng)建表的方法

字號:


    這篇文章主要介紹了python實(shí)現(xiàn)在sqlite動態(tài)創(chuàng)建表的方法,涉及Python操作SQLite數(shù)據(jù)庫創(chuàng)建數(shù)據(jù)表的技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    本文實(shí)例講述了python實(shí)現(xiàn)在sqlite動態(tài)創(chuàng)建表的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
    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")
    希望本文所述對大家的Python程序設(shè)計(jì)有所幫助。