摘要: local推导步骤 #不用local from threading import Thread import time lqz = -1 def task(arg): global lqz lqz = arg time.sleep(2) #最后显示9个相同的数字 print(lqz) for i i 阅读全文
posted @ 2019-07-18 15:03 pdun 阅读(291) 评论(0) 推荐(1) 编辑
摘要: 典型写法 默认转换器 DEFAULT_CONVERTERS = { 'default': UnicodeConverter, 'string': UnicodeConverter, #常用 'any': AnyConverter, 'path': PathConverter, 'int': Inte 阅读全文
posted @ 2019-07-18 10:13 pdun 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 一、请求扩展 from flask import Flask,request app=Flask(__name__) @app.before_request def process(): request.name='pdun' print('请求来的时候') @app.route('/') def 阅读全文
posted @ 2019-07-18 08:35 pdun 阅读(2159) 评论(0) 推荐(0) 编辑