python-sqlite3.html
import sqlite3
# test db(file name)
# :memory: means RAM
db = '''test_db'''
sql_t_person = '''create table person (name text)'''
def main():
con = sqlite3.connect(db)
con.isolation_level = None # autocommit
cur = con.cursor()
# create test_db
cur.execute(sql_t_person)
cur.close()
return 0
if __name__ == '__main__': main()
import sqlite3
# test db(file name)
# :memory: means RAM
db = '''test_db'''
sql_t_person = '''create table person (name text)'''
def main():
con = sqlite3.connect(db)
con.isolation_level = None # autocommit
cur = con.cursor()
# create test_db
cur.execute(sql_t_person)
cur.close()
return 0
if __name__ == '__main__': main()
댓글
댓글 쓰기