import mysql.connector
from mysql.connector import connect, Error
try:
with connect(
host='localhost',
user=SQLUSER,
password=SQLPASS,
database=SQLBASE
) as connection:
print(connection)
except Error as e:
print(e)
sum
.name
не вернётся примерно никогда.int()
прежде чем сравнивать с цифрами, иначе условие не выполняется.if ((int(clas) == 9) and (int(su) > 180)) or ((int(clas) == 10) and (int(su) > 200)) or ((int(clas) == 11) and (int(su) > 220)):
import os
from fastapi import FastAPI
from fastapi.responses import FileResponse
app = FastAPI()
@app.get("/")
async def main():
file_name = "FILE NAME"
# DEPENDS ON WHERE YOUR FILE LOCATES
file_path = os.getcwd() + "/" + file_name
return FileResponse(path=file_path, media_type='application/octet-stream', filename=file_name)