import sqlite3
def connect_to_sqlite(db_name):
"""
Connect to a sqlite database.
Parameters
----------
db_name : str
The name of the database to connect to.
Returns
-------
sqlite3.Connection
The connection to the database.
"""
#connect to the database
conn = sqlite3.connect(db_name)
#return the connection
return conn
#example
conn = connect_to_sqlite('test.db')
#output
print(conn) #<sqlite3.Connection object at 0x7f8b9d8b5e90>
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (0)