Create creatopenAutoDB.py
This commit is contained in:
parent
2fd7e1f9df
commit
065acd7fe8
1 changed files with 16 additions and 0 deletions
16
openAutoDB/creatopenAutoDB.py
Normal file
16
openAutoDB/creatopenAutoDB.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import sqlite3
|
||||||
|
from sqlite3 import Error
|
||||||
|
|
||||||
|
|
||||||
|
def create_connection(db_file):
|
||||||
|
""" create a database connection to a SQLite database """
|
||||||
|
try:
|
||||||
|
conn = sqlite3.connect(db_file)
|
||||||
|
print(sqlite3.version)
|
||||||
|
except Error as e:
|
||||||
|
print(e)
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
create_connection("/home/pi/openAutoDB/openAuto.db")
|
||||||
Loading…
Reference in a new issue