#6 Added Auto-installer for requirements

This commit is contained in:
marcus 2022-03-18 12:55:29 +01:00
parent cf6abeaeb0
commit cbcdfcf11e
4 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,5 @@
# TODO: Datenbank Klasse (CRUD) # TODO: Datenbank Klasse (CRUD)
import mysql.connector import mysql.connector

View File

@ -12,4 +12,5 @@ def db_connection(user, password, host):
connection = mysql.connector.connect(user=user, password=password, host=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)
print('Veruche deinen Mysql Server neuzustarten')
return connection.cursor() return connection.cursor()

View File

@ -4,10 +4,11 @@
# Datenbanken (CRUD) Tabellen (CRUD) # Datenbanken (CRUD) Tabellen (CRUD)
import main_menu import main_menu
import requirements_installer
# Aufruf des Main Menüse # Aufruf des Main Menüse
def main(): def main():
# requirements_installer.installer()
main_menu.main_menu() main_menu.main_menu()

View File

@ -0,0 +1,8 @@
import sys
import subprocess
# implement pip as a subprocess:
def installer():
subprocess.check_call([sys.executable, '-m', 'pip', 'install',
'mysql-connector-python'])