This commit is contained in:
parent
cbcdfcf11e
commit
7655c068f4
|
@ -12,5 +12,5 @@ def db_connection(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('Veruche deinen Mysql Server neuzustarten')
|
||||
print('Veruche deinen Mysql Server neu zu starten')
|
||||
return connection.cursor()
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import database
|
||||
import database_connection
|
||||
import config
|
||||
import main_menu
|
||||
|
||||
|
||||
# Auskommentieren falls Server offline
|
||||
cursor = database_connection.db_connection(config.user, config.password, config.host)
|
||||
|
||||
|
||||
# Datenbank Menü
|
||||
|
@ -12,12 +13,13 @@ def menu():
|
|||
selection = {0: 'Datenbanken anzeigen', 1: 'Datenbank erstellen', 2: 'Datenbank löschen', 3: 'Datenbank umbenennen',
|
||||
4: 'Datenbank auselesen',
|
||||
5: 'Tabelle erstellen', 6: 'Tabelle umbenennen', 7: 'Tabelle löschen', 8: 'Tabelle auselsen',
|
||||
9: 'In Tabelle einfügen', 10: 'Tabellen anzeigen'}
|
||||
9: 'In Tabelle einfügen', 10: 'Tabellen anzeigen', 11: 'Zurück zum Hauptmenü'}
|
||||
|
||||
print('#Datenbank Menü# \n'
|
||||
'\nWas möchtest du tun?\n')
|
||||
|
||||
while enable_menu:
|
||||
cursor = database_connection.db_connection(config.user, config.password, config.host)
|
||||
for key, value in selection.items():
|
||||
print(key, value)
|
||||
selection_number = int(input('Bitte Auswahl treffen'))
|
||||
|
@ -42,5 +44,22 @@ def menu():
|
|||
print('#Tabelle erstellen#')
|
||||
table_name = input('Wie soll die Datenbank heißen?')
|
||||
database.create(cursor, table_name, _type)
|
||||
case 6:
|
||||
# TODO Funktion
|
||||
return
|
||||
case 7:
|
||||
# TODO Funktion
|
||||
return
|
||||
case 8:
|
||||
# TODO Funktion
|
||||
return
|
||||
case 9:
|
||||
# TODO Funktion
|
||||
return
|
||||
case 10:
|
||||
# TODO Funktion
|
||||
return
|
||||
case 11:
|
||||
main_menu.main_menu()
|
||||
|
||||
break
|
||||
|
|
|
@ -1 +1 @@
|
|||
# TODO: einlsen der berreits vorhanden Daten im JSON File
|
||||
# TODO: einlesen der berreits vorhanden Daten im JSON File
|
9
main.py
9
main.py
|
@ -2,13 +2,20 @@
|
|||
# Auswahlmenü ( Neue Fragen/ Oder Abfrage)
|
||||
# Ein und Ausgabe der Fragen/Antworten
|
||||
# Datenbanken (CRUD) Tabellen (CRUD)
|
||||
import time
|
||||
|
||||
import main_menu
|
||||
import requirements_installer
|
||||
|
||||
# Aufruf des Main Menüse
|
||||
|
||||
# Aufruf des Main Menüs
|
||||
def main():
|
||||
print('Programm wird in 5 Sekunden gestartet, bitte gewährleiste, dass beim Programmstart dein Mysql Server '
|
||||
'online ist\n')
|
||||
time.sleep(5)
|
||||
print('Installation vom Mysql Connector')
|
||||
# requirements_installer.installer()
|
||||
|
||||
main_menu.main_menu()
|
||||
|
||||
|
||||
|
|
|
@ -5,4 +5,4 @@ import subprocess
|
|||
# implement pip as a subprocess:
|
||||
def installer():
|
||||
subprocess.check_call([sys.executable, '-m', 'pip', 'install',
|
||||
'mysql-connector-python'])
|
||||
'mysql-connector-python'])
|
||||
|
|
Loading…
Reference in New Issue
Block a user