#6 Added Auto-installer for requirements
This commit is contained in:
parent
cf6abeaeb0
commit
cbcdfcf11e
|
@ -1,4 +1,5 @@
|
|||
# TODO: Datenbank Klasse (CRUD)
|
||||
|
||||
import mysql.connector
|
||||
|
||||
|
||||
|
|
|
@ -12,4 +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')
|
||||
return connection.cursor()
|
||||
|
|
3
main.py
3
main.py
|
@ -4,10 +4,11 @@
|
|||
# Datenbanken (CRUD) Tabellen (CRUD)
|
||||
|
||||
import main_menu
|
||||
|
||||
import requirements_installer
|
||||
|
||||
# Aufruf des Main Menüse
|
||||
def main():
|
||||
# requirements_installer.installer()
|
||||
main_menu.main_menu()
|
||||
|
||||
|
||||
|
|
8
requirements_installer.py
Normal file
8
requirements_installer.py
Normal 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'])
|
Loading…
Reference in New Issue
Block a user