V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shinerene
V2EX  ›  Python

Flask的问题

  •  
  •   shinerene ·
    Xiechen · 2013-04-29 11:20:36 +08:00 · 3008 次点击
    这是一个创建于 4016 天前的主题,其中的信息可能已经有所发展或是发生改变。
    请问有人用Flask么 我刚刚在学 请问Flask的g是干什么用得?
    6 条回复    1970-01-01 08:00:00 +08:00
    bigeagle
        1
    bigeagle  
       2013-04-29 12:32:06 +08:00
    是一个thread local的全局变量
    shinerene
        2
    shinerene  
    OP
       2013-04-29 13:10:03 +08:00
    @bigeagle 额 能不能再说的具体点呢。。我看到一句是g.user比如说这句是做什么用的呢 ?
    zhy0216
        3
    zhy0216  
       2013-04-29 15:10:01 +08:00
    @shinerene g就理解成一个全局的变量, 你可以往里面存东西~~
    shinerene
        4
    shinerene  
    OP
       2013-04-29 15:17:52 +08:00
    @zhy0216 哦哦~这样啊~
    还想请问个问题 request是怎么用的呢?
    再看flask的文档 可是很多查找不是很方便呢 不像python官方文档有专门的lib库的pdf
    zhy0216
        5
    zhy0216  
       2013-04-29 18:37:59 +08:00
    @shinerene 把文档先粗略的读一遍吧, 然后哪里有问题哪里查~
    xingzhi
        6
    xingzhi  
       2013-04-29 18:51:04 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3031 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:34 · PVG 16:34 · LAX 01:34 · JFK 04:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.