【发布时间】:2016-04-19 09:13:19
【问题描述】:
我有一个带有按钮的 HTML 页面。这个网页在 Flask 上运行。我想做的是当用户按下按钮时,我想调用 Python 方法。
main.py
from flask import url_for, Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('tour.html')
if __name__ == '__main__':
app.run(debug=True)
def first():
global todayDate
parseWemake(*Wemake.wemakeData())
parseCoupang(*Coupang.coupangData())
parseTmon(*Tmon.tmonData())
tour.html
<button>Click</button>
我现在迷路了。我要做的就是在单击 html 上的那个按钮时调用 first() 方法。
提前致谢。
【问题讨论】:
标签: javascript python html