diff --git a/mate.py b/mate.py new file mode 100644 index 0000000..d26fb3a --- /dev/null +++ b/mate.py @@ -0,0 +1,8 @@ + +# mws = matewirtschaftssystem +def mws(): + print("Mate") + + +def materechner(): + print("eine Mate haha") \ No newline at end of file diff --git a/picker.py b/picker.py index dd174d4..b6889be 100644 --- a/picker.py +++ b/picker.py @@ -42,32 +42,5 @@ def picker(gamefile, session_id, spieler_id): shutil.move(gamefile, session_id) -def create_chart(session_id,spiel_name): - """ create chart of game """ - con = sqlite3.connect("party.db") - cur = con.cursor() - dateiname = session_id + spiel_name + ".png" - try: - l = f"SELECT 'username' FROM user INNER JOIN game ON game.userID = user.userID;" - user = [i[0] for i in cur.execute(l).fetchall()] - except: - print("Fehler beim Ausführen von:" + l) - try: - l = f"""SELECT ZEIT - FROM game - WHERE sessionID = \'{session_id}\' AND Spielname = \'{spiel_name}\';""" - zeit = [i[0] for i in cur.execute(l).fetchall()] - except: - print("Fehler beim Ausführen von:" + l) - - colors = ['green','blue','purple','brown','teal', 'yellow', 'black', 'orange'] - plt.bar(user, zeit, color=colors) - plt.title(spiel_name, fontsize=14) - plt.xlabel('User', fontsize=14) - plt.ylabel('Zeit in Sekunden', fontsize=14) - plt.grid(False) - plt.savefig(dateiname) - - if __name__ == "__main__": print("Use main.py to use program") diff --git a/statistik.py b/statistik.py new file mode 100644 index 0000000..d95ddea --- /dev/null +++ b/statistik.py @@ -0,0 +1,27 @@ +import matplotlib.pyplot as plt + +def create_chart(session_id,spiel_name): + """ create chart of game """ + con = sqlite3.connect("party.db") + cur = con.cursor() + dateiname = session_id + spiel_name + ".png" + try: + l = f"SELECT 'username' FROM user INNER JOIN game ON game.userID = user.userID;" + user = [i[0] for i in cur.execute(l).fetchall()] + except: + print("Fehler beim Ausführen von:" + l) + try: + l = f"""SELECT ZEIT + FROM game + WHERE sessionID = \'{session_id}\' AND Spielname = \'{spiel_name}\';""" + zeit = [i[0] for i in cur.execute(l).fetchall()] + except: + print("Fehler beim Ausführen von:" + l) + + colors = ['green','blue','purple','brown','teal', 'yellow', 'black', 'orange'] + plt.bar(user, zeit, color=colors) + plt.title(spiel_name, fontsize=14) + plt.xlabel('User', fontsize=14) + plt.ylabel('Zeit in Sekunden', fontsize=14) + plt.grid(False) + plt.savefig(dateiname) \ No newline at end of file