打印/下载
框架

安装

# Python3
yum install python36 python36-devel python3-pip

# Flask框架
pip3 install flask

# 测试项目
mkdir $HOME/works/www/flask

Demo( flask/index.py )

#!/bin/python
# -*- coding: UTF-8 -*-

from flask import Flask
app = Flask(__name__)

@app.route('/',methods=['GET', 'POST'])
def index():
    return 'Hello World!'

if __name__ == '__main__':
    app.run(host='127.0.0.1',port=5000)

运行

python index.py
{{copy}}