V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · 9402 views
    This topic created in 5401 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   ·   Solana   ·   2027 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 16:14 · PVG 00:14 · LAX 09:14 · JFK 12:14
    ♥ Do have faith in what you're doing.