< 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')
|


'PRACTICE > Basic' 카테고리의 다른 글
[Flask] int, float값 구분하여 웹 페이지 호출 (0) | 2020.09.03 |
---|---|
[Flask] render_template 사용하여 count 출력 (0) | 2020.09.03 |
[C] %s, %c, null문자에 따른 출력값 비교 + 포인터변수에 배열주소를 저장하고 배열에 저장된 값 출력하기 (0) | 2020.08.24 |
[Arduino] 간단한 프린트문, 8개의 LED를 비트단위로 ON/OFF 하기 (0) | 2020.08.18 |
[C] 포인터와 함수를 이용해서 배열 전체값, 평균값, 최대값 출력하기 (0) | 2020.07.16 |
댓글