PRACTICE/Basic
[Flask] escape, request 사용하여 웹에서 입력받은 값 출력
1005
2020. 9. 3. 17:22
< Flask Tutorial >
Flask Tutorial - Tutorialspoint
Flask Tutorial Flask is a web application framework written in Python. Armin Ronacher, who leads an international group of Python enthusiasts named Pocco, develops it. Flask is based on Werkzeug WSGI toolkit and Jinja2 template engine. Both are Pocco proje
www.tutorialspoint.com
1
2
3
4
5
6
7
8
9
10
11
12
13
|
from flask import Flask, escape, request
app = Flask(__name__) #생성자, 시작지점
@app.route('/') #루트경로
def mainPage(): #사용자 지정 함수
#기본 출력값은 world, 웹에서 input값이 들어오면 input값을 출력
name = request.args.get('input','world')
return f'Hello {escape(name)}' #name에 저장된 값을 웹에 출력.
if __name__ == '__main__':
app.run(host='0.0.0.0',debug=True, port='80')
|

