摘要: from flask import Flask,request,session,url_for,current_app from werkzeug.local import Local,LocalStack #线程隔离技术 #只要绑定在Local对象上的属性 #在每个线程中都是隔离 app = Flask(__name__) # print(current_app.name)#Runtim... 阅读全文
posted @ 2018-10-06 21:39 python成长中 阅读(251) 评论(0) 推荐(0)
摘要: from threading import Thread from werkzeug.local import Local local = Local()#实例化一个线程隔离对象 request = '123' class MyThread(Thread): def run(self): global request request = 'ab... 阅读全文
posted @ 2018-10-06 12:01 python成长中 阅读(501) 评论(0) 推荐(0)