From bc6134fdbbf628945537fe5590734da8f7e812b0 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 17 Mar 2022 13:36:16 +0100 Subject: [PATCH] #1 --- database_connection.py | 7 ++++--- main.py | 6 +++++- questions_awnsers.json | 0 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 questions_awnsers.json diff --git a/database_connection.py b/database_connection.py index 42fe0f5..ad738b3 100644 --- a/database_connection.py +++ b/database_connection.py @@ -2,11 +2,12 @@ import mysql.connector + def db_connection(user, password, host): - connection = None + connection = '' try: - connection = mysql.connector.connect(user, password, host) + connection = mysql.connector.connect(user=user, password=password, host=host) except mysql.connector.Error as err: - print('Something went wrong' , err) + print('Something went wrong', err) return connection.cursor() diff --git a/main.py b/main.py index c651130..b9085fc 100644 --- a/main.py +++ b/main.py @@ -5,10 +5,14 @@ import config import database_connection + def menue(): # TODO MenĂ¼ erstellen return def main(): - database_connection.db_connection(config.user, config.password, config.host) \ No newline at end of file + database_connection.db_connection(config.user, config.password, config.host) + + +main() \ No newline at end of file diff --git a/questions_awnsers.json b/questions_awnsers.json new file mode 100644 index 0000000..e69de29