Python flask使用实例
生活随笔
收集整理的這篇文章主要介紹了
Python flask使用实例
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
找個源碼 、send_file
from flask import request from flask import Flask from flask import render_template from flask import send_file#import settings import osapp = Flask(__name__, static_url_path='')@app.route('/') def index():#with open("login.html") as f:# text = f.read()#return textreturn send_file("login.html", cache_timeout=0) # return app.send_static_file("./login.html")""" @app.route('/css/bootstrap.css') def bootstrap():#with open("css/bootstrap.css") as f:# text = f.read()#return textreturn send_file("css/bootstrap.css") """@app.route('/css/<title>') def same_title(title):print (title)if __name__ == '__main__':app.run(host = "0.0.0.0",port = 80)?
總結
以上是生活随笔為你收集整理的Python flask使用实例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python 获取重定向url
- 下一篇: websocket python爬虫_p