Created
January 6, 2021 10:50
-
-
Save gb103/fca68f85b6a17c6e7215c97cb3ce95f0 to your computer and use it in GitHub Desktop.
To create a DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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