Python getpass.getpass() function call hangs

后端 未结 5 1036
广开言路
广开言路 2021-01-06 01:10

I am trying to get a prompt that will ask for my password but when I try to call getpass.getpass() it just freezes. I am running on Windows 7 64 bit using Pytho

5条回答
  •  甜味超标
    2021-01-06 01:47

    Faced the same issue with getpass (mingw64) and found this simple solution.

    os.system("stty -echo")
    password = input('Enter Password:')
    os.system("stty echo")
    print("")
    

提交回复
热议问题