dwm-app/src/util/utils.py

14 lines
335 B
Python
Raw Normal View History

2024-02-14 20:55:41 +00:00
import sqlite3, csv
DATABASE = "src/data/database.db"
def connect_db():
return sqlite3.connect(DATABASE)
def read_csv(file_path):
data = []
with open(file_path, 'r', newline='', encoding='utf-8') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
data.append(row)
return data