首页 > python 中如何将上下文环境保存下来

python 中如何将上下文环境保存下来

我想做一个用 http 方式调用交互器,但是由于 http 是无状态的,我只好将 python 的 locals 存入到 session 里,然后下次请求再还原回来。

1。 不知道怎么能把 locals() 获取到的字典,写回到新的上下文空间。
2。 或者,整个思路都是错的?那http 方式的 python 交互器应该怎么做?


https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/debug/console.py#L175

【热门文章】
【热门文章】