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

python2.7中怎样实现用户输入密码用*显示

  •  
  •   xiangpeng · Feb 6, 2012 · 8567 views
    This topic created in 5347 days ago, the information mentioned may be changed or developed.
    RT 新手请教,看了下有个模块是getpass,没太看懂,有没有什么别的,请指教。
    6 replies  •  1970-01-01 08:00:00 +08:00
    fanzeyi
        1
    fanzeyi  
       Feb 6, 2012
    getpass很难懂么

    import getpass

    pass = getpass.getpass('Password:')
    013231
        2
    013231  
       Feb 6, 2012
    getpass输入密码是不回显的. unix风格的输入密码就是不回显的, 为何要显示*呢?
    loading
        3
    loading  
       Feb 6, 2012
    getpass为什么不能可选回显*呢?(我没看文档,可能有误,望指正)
    phus
        4
    phus  
       Feb 6, 2012
    xiangpeng
        5
    xiangpeng  
    OP
       Feb 6, 2012
    @fanzeyi 不是我看不懂,但是我在win下的python2.7中提示警告,怎么办?
    xiangpeng
        6
    xiangpeng  
    OP
       Feb 6, 2012
    好了 明白了 谢了各位。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   849 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 19:15 · PVG 03:15 · LAX 12:15 · JFK 15:15
    ♥ Do have faith in what you're doing.