noch mehr Dateien

This commit is contained in:
fingadumbledore 2023-05-06 11:14:14 +02:00
parent 55bdd3602a
commit ac16094271
2 changed files with 24 additions and 1 deletions

View File

@ -3,7 +3,18 @@ import sqlite3
def dbcon():
con = sqlite3.Connection("party.db")
cur = con.cursor()
def return_dbcon(sql):
try:
con = sqlite3.connect("party.db")
log_server("return_dbcon hat die Verbindung mit db aufgenommen", "WARNING")
cur = con.cursor()
ergebnis = cur.execute(sql).fetchall()
con.commit()
return ergebnis
except:
return "Error"
def create_db():
conn = sqlite3.connect("chat.db")
c = conn.cursor()

12
log.py Normal file
View File

@ -0,0 +1,12 @@
def clear_log():
print("f")
def log_server(log, type):
log = date + ' [' + type + '] ' + log
datei = open('server.log', 'a')
datei.write('\n' + " " + log)
log = date
datei.close()
def chat_log():
print("chat_log")