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
RadishWind
V2EX  ›  Python

关于 Flask 输出 list 的问题

  •  
  •   RadishWind ·
    Ph0enixxx · 2015-09-17 22:13:33 +08:00 · 4205 次点击
    这是一个创建于 3137 天前的主题,其中的信息可能已经有所发展或是发生改变。

    def query (key ):
    results = searcher.find ("content", key )
    tmp=[]
    for i in results:
    tmp.append (i )
    print (tmp )
    print (type (tmp ))
    #print (results )
    return "".join (tmp )
    请问这个代码为什么在控制台输出很正常 而在 flask 框架中输出不出来呢?

    1 条回复    2015-09-18 08:57:02 +08:00
    firemiles
        1
    firemiles  
       2015-09-18 08:57:02 +08:00   ❤️ 1
    logger
    A logging.Logger object for this application. The default configuration is to log to stderr if the application is in debug mode. This logger can be used to (surprise ) log messages. Here some examples:

    ```python
    app.logger.debug ('A value for debugging')
    app.logger.warning ('A warning occurred (%d apples )', 42 )
    app.logger.error ('An error occurred')
    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2867 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:27 · PVG 22:27 · LAX 07:27 · JFK 10:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.