以下代码段:
perl -wT
print "$_\n" for @INC;
在Visual Studio Code的集成Python控制台中运行时,会产生以下结果:
from getpass import getpass
username = input("Username: ")
password = getpass("Password: ")
因此,显示密码提示后我键入的任何内容。有什么办法可以在集成的VS Code终端中隐藏它吗?例如在正常命令提示符下运行时
Username: User
Warning: Password input may be echoed.
Password: hunter2
我得到以下输出:
python test.py
因此,正如预期的那样,在密码提示后我在此处输入的任何内容都不会显示。