Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python:如何;星号“out”在屏幕上键入密码时隐藏密码?_Python_Passwords_Pyscripter - Fatal编程技术网

Python:如何;星号“out”在屏幕上键入密码时隐藏密码?

Python:如何;星号“out”在屏幕上键入密码时隐藏密码?,python,passwords,pyscripter,Python,Passwords,Pyscripter,此处未定义Auth_url,但在较长的版本中,它已定义并成功登录。问题是,出现的输入框没有“星号”显示密码。有没有简单的方法来纠正这个问题?谢谢 from suds.client import Client from suds.xsd.doctor import Import, ImportDoctor from suds.sax.element import Element import getpass user = "my username" pw = getpass.getpass("P

此处未定义Auth_url,但在较长的版本中,它已定义并成功登录。问题是,出现的输入框没有“星号”显示密码。有没有简单的方法来纠正这个问题?谢谢

from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor
from suds.sax.element import Element
import getpass

user = "my username"
pw = getpass.getpass("Password: ")
auth_client = Client(auth_url)
cookie = auth_client.service.authenticate(user, pw)
问题在于Pyscripter。如果在cmd中运行代码或将其转换为.exe,则应能正常工作


你从哪里弄来的?我已经试过了,它会像预期的那样隐藏输入。Pyscripter 2.7感谢您可以尝试调整,它实现了
getch()
函数,在读取每个字符后回显星号。此外,这个问题的答案可能会有帮助:对于有相同问题的人。这段代码有效,问题在于Pyscripter。如果在cmd中运行代码或将其转换为.exe,则应能正常工作。