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

如何在raw_input() 用中文做提示

  •  
  •   yhdjw · Jul 25, 2011 · 9694 views
    This topic created in 5547 days ago, the information mentioned may be changed or developed.
    python版本 2.7.2
    用utf-8
    raw_input(u'中文')
    #中文变乱码
    提示
    难道raw_input里不能输入中文?
    2 replies  •  1970-01-01 08:00:00 +08:00
    c
        1
    c  
       Jul 25, 2011
    raw_input(u'中文'.encode('gbk'))

    中文CMD编码默认为GB2312
    yhdjw
        2
    yhdjw  
    OP
       Jul 25, 2011
    谢谢大大啊 可以了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2556 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 14:21 · PVG 22:21 · LAX 07:21 · JFK 10:21
    ♥ Do have faith in what you're doing.