MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / create_connection

Function create_connection

projects/Quiz Game/main.py:6–13  ·  view source on GitHub ↗

create a database connection to the SQLite database

(db_file)

Source from the content-addressed store, hash-verified

4
5# create Conn to have the database file
6def create_connection(db_file):
7 """create a database connection to the SQLite database"""
8 conn = None
9 try:
10 conn = sqlite3.connect(db_file)
11 except sqlite3.Error as e:
12 print(e)
13 return conn
14
15
16# store the player's score with their name

Callers 1

main.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected