init eACGM

This commit is contained in:
Tokisakix
2025-08-07 10:14:54 +08:00
commit 7a4a0b1b14
51 changed files with 11495 additions and 0 deletions

19
eacgm/webui/connect.py Normal file
View File

@@ -0,0 +1,19 @@
# connect to mysql database
import mysql.connector
class database:
def __init__(self, ip, port, user, pwd, database) -> None:
self.conn = mysql.connector.connect(
host = ip,
port = port,
user = user,
password = pwd,
database = database
)
self.cursor = self.conn.cursor()
def exec(self, cmd: str):
self.cursor.execute(cmd)
result = self.cursor.fetchall()
self.conn.commit()
return result