-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtest
56 lines (36 loc) · 1020 Bytes
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import xlrd
import mysql.connector
import gc
import pandas as pd
from flask import Flask, render_template, request
__author__ = ''
app = Flask(__name__)
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
@app.route("/")
def index():
return render_template("upload.html")
@app.route("/upload", methods=['POST'])
def upload():
data = request.files['file']
df = pd.read_excel(data, sheet_name='Sheet1')
print(df.columns.tolist())
// database(df)
# target = os.path.join(APP_ROOT, 'images/')
# print(targetile
#
# if not os.path.isdir(target):
# os.mkdir(target)
#
# for file in request.files.getlist("file"):
# print(file)
# filename = file.filename
# destination = "/".join([target, filename])
# print(destination)
# file.save(destination)
return render_template("complete.html")
#start()
#if __name__ == "__main__":
# app.run()
if __name__ == "__main__":
app.run(port=4555, debug=True)