兴趣来潮想复习一下python中的getpass模块编辑器使用Pycharm很简单的代码写完执行不到输入部分代码如下
import getpass
print("""
--------------------**************-----------------
""")
#ss=getpass.getpass('please The password:')
p = getpass.getpass('input your password:')
print(s)
执行结果
C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python.exe C:/Users/Administrator/PycharmProjects/s14/helloword.py
--------------------**************-----------------
但是事与愿违并没有出现理想的状况 input your password: ,由于初学python所以始终自己哪里敲错了检查了几遍没有错误同时执行的时候没有任何的报错就想着是不是编辑器的原因
于是在Windows的命令行执行以上代码出现了预期的结果
C:\Users\Administrator>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import getpass
>>> p=getpass.getpass('input your password:')
input your password:
>>> print(p)
88
>>> p=getpass.getpass('input your password:')
input your password:
>>> print(p)
在其他工具下执行也出现了预期的结果于是就比较纳闷了开始百度和各种找资料最后发现Pycharm竟然不支持getpass模块。
转载于:https://blog.51cto.com/dreamlinux/1907763