mirror of
https://github.com/lucaspalomodevelop/Party.git
synced 2026-03-13 00:07:21 +00:00
umbau
This commit is contained in:
parent
c6cb5eaf72
commit
2b4f1b2929
8
mate.py
Normal file
8
mate.py
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
# mws = matewirtschaftssystem
|
||||
def mws():
|
||||
print("Mate")
|
||||
|
||||
|
||||
def materechner():
|
||||
print("eine Mate haha")
|
||||
27
picker.py
27
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")
|
||||
|
||||
27
statistik.py
Normal file
27
statistik.py
Normal file
@ -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)
|
||||
Loading…
x
Reference in New Issue
Block a user