Skip to content

Instantly share code, notes, and snippets.

@gb103
Created January 6, 2021 10:50
Show Gist options
  • Save gb103/fca68f85b6a17c6e7215c97cb3ce95f0 to your computer and use it in GitHub Desktop.
Save gb103/fca68f85b6a17c6e7215c97cb3ce95f0 to your computer and use it in GitHub Desktop.
To create a DB
import sqlite3
from sqlite3 import Error
def create_connection(db_file):
""" create a database connection to a SQLite database """
conn = None
try:
conn = sqlite3.connect(db_file)
print(sqlite3.version)
except Error as e:
print(e)
finally:
if conn:
conn.close()
if __name__ == '__main__':
create_connection("/Users/gaurav.bansal1/Desktop/image-detection/FaceBase.db")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment