add readexcell func

This commit is contained in:
2024-05-06 15:14:47 +03:00
parent cb862c63a6
commit 9cde4e2c7d
3 changed files with 33 additions and 1 deletions

34
app.py
View File

@@ -7,6 +7,9 @@ from datetime import *
import csv
import random
from urllib.parse import unquote
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import generate_password_hash, check_password_hash
from openpyxl import load_workbook
app = Flask(__name__)
@@ -22,6 +25,13 @@ db.init_app(app)
migrate = Migrate(app, db)
@app.route("/login", methods=['GET', 'POST'])
def login():
return render_template('login.html')
@app.route("/", methods=['GET', 'POST'])
def index():
results = []
@@ -264,10 +274,32 @@ def createdb():
db.session.commit()
def write2excell():
wb = load_workbook("VedomostMOL.xlsx")
sheet = wb.worksheets[0]
x=19314
with app.app_context():
joinQuery = db.session.query(Oboruds, Auditory).filter(
Oboruds.aud_id == Auditory.id).filter(
Oboruds.invNumber==x)
print(joinQuery.all())
for i in range(10):
cell = 'B'+str(i+6)
if __name__ == '__main__':
#write2excell()
#ranomraspr()
#createdb()
app.run(debug=True, host='0.0.0.0', port='3800')