【Python Web】flask1
生活随笔
收集整理的這篇文章主要介紹了
【Python Web】flask1
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
簡單web server實(shí)現(xiàn)
基于flask實(shí)現(xiàn)簡單webserver,然后訪問http://localhost:5000即可
from flask import Flask, requestapp = Flask(__name__)@app.route('/') def hello():return 'hello'@app.route('/get', methods=['GET']) def hello_get():name = requests.args.get('name')return f'hello {name}'app.run() 與50位技術(shù)專家面對面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的【Python Web】flask1的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【数据结构与算法】常用算法
- 下一篇: python super