推荐学习书目
› 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
chaojie
V2EX  ›  Python

又在编码上弄了半天

  •  
  •   chaojie ·
    cchaojie · Sep 27, 2012 · 3939 views
    This topic created in 5110 days ago, the information mentioned may be changed or developed.
    BAE上代码刷新几次,有时正常,有时报错,一直很纳闷

    sys.getdefaultencoding() 几乎每次刷新结果都不一样

    突然想到,原来是在云上,还正好是分配在了几台编码配置不同的地方

    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')

    这样一改才好了
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   840 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 20:41 · PVG 04:41 · LAX 13:41 · JFK 16:41
    ♥ Do have faith in what you're doing.