python 3.x - Create and access sqlite3 database using python3 -
i trying create (and later, access) database using python3. millions of example in , internet(eg. this), doing:
#!/usr/bin/env python3 string import ascii_uppercase import sqlite3 sqlfile = "jour.db" tabname = "abbre" id_col = "full_name" col_name = "abbre_name" conn = sqlite3.connect(sqlfile) c = conn.cursor() c.execute('''create table journals (jid int, full text , abbr text)''') c.execute("""insert journals values (1, 'physical review b', 'phys. rev. b')""") conn.commit() c.close()
but, creating table, no data inserted.
you looking @ wrong database file. (the schema different.)
connecting file name jour.db
use current directory, whatever happens be. correct jour.db
database file somewhere on computer.
it might idea specify full path of database file.
Comments
Post a Comment