-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.py
51 lines (40 loc) · 1.15 KB
/
generate.py
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
from flask import Flask, render_template, make_response,request
app = Flask(__name__)
Q1 = []
im=[]
logo="xyx"
colname="xyx"
@app.route('/generate')
def generate():
return render_template('form.html')
@app.route('/generate', methods=['post', 'get'])
def form_input():
if request.method == 'POST':
Q1.append(request.form.get('Q_1'))
im.append(request.form.get('images'))
l=request.form.get('logo')
print(im)
return render_template('form.html')
@app.route('/index')
def pdf_template():
return render_template('pdf_template.html',Q1=Q1,x=len(Q1),im=im,y=len(im),colname=colname,logo=logo,head=head,mark=mark)
@app.route('/new',)
def new():
Q1.clear()
im.clear()
return render_template('form.html')
@app.route('/log',methods=['post', 'get'])
def log():
if request.method == 'POST':
global colname
global logo
global head
global mark
colname=request.form.get('colname')
logo=request.form.get('logo')
head=request.form.get('head')
mark=request.form.get('mark')
return render_template('form.html',c=colname,l=logo)
return render_template('front.html')
if __name__ == '__main__':
app.run(debug=True)