small fix to use the configured db instead of hardcoded.
This commit is contained in:
parent
287246c6fb
commit
34df5fc6ee
1 changed files with 7 additions and 1 deletions
8
db.py
8
db.py
|
@ -1,7 +1,13 @@
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import configparser
|
||||||
|
|
||||||
|
# Read config to get database location
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read('config.ini')
|
||||||
|
|
||||||
# Connect to SQLite database (or create it if it doesn't exist)
|
# Connect to SQLite database (or create it if it doesn't exist)
|
||||||
conn = sqlite3.connect('gacha_game.db')
|
db_path = config['application']['DatabaseLocation']
|
||||||
|
conn = sqlite3.connect(db_path)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# Create tables
|
# Create tables
|
||||||
|
|
Loading…
Add table
Reference in a new issue