This commit is contained in:
parent
5678c31efb
commit
bc6134fdbb
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
import mysql.connector
|
import mysql.connector
|
||||||
|
|
||||||
|
|
||||||
def db_connection(user, password, host):
|
def db_connection(user, password, host):
|
||||||
connection = None
|
connection = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
connection = mysql.connector.connect(user, password, host)
|
connection = mysql.connector.connect(user=user, password=password, host=host)
|
||||||
except mysql.connector.Error as err:
|
except mysql.connector.Error as err:
|
||||||
print('Something went wrong' , err)
|
print('Something went wrong', err)
|
||||||
return connection.cursor()
|
return connection.cursor()
|
||||||
|
|
4
main.py
4
main.py
|
@ -5,6 +5,7 @@
|
||||||
import config
|
import config
|
||||||
import database_connection
|
import database_connection
|
||||||
|
|
||||||
|
|
||||||
def menue():
|
def menue():
|
||||||
# TODO Menü erstellen
|
# TODO Menü erstellen
|
||||||
return
|
return
|
||||||
|
@ -12,3 +13,6 @@ def menue():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
database_connection.db_connection(config.user, config.password, config.host)
|
database_connection.db_connection(config.user, config.password, config.host)
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
0
questions_awnsers.json
Normal file
0
questions_awnsers.json
Normal file
Loading…
Reference in New Issue
Block a user