2017-11-09 3 views
1

私は入力を非表示にするGETPASSを使用しようとしているが、それはちょうど私は、このエラーを与える:GETPASSはスパイダーのために働いていません(パイソン)

"Warning: QtConsole does not support password mode, the text you type will be visible."

私はスパイダーを使用しています。ここに私のコードです:

import getpass 

pswd = getpass.getpass('Password:') 

if pswd== 'whatever': 
    print ('\nACCESS GRANTED') 
else: 
    print('\nACCESS DENITED') 
+0

プログラムはまだ動作しますが、パスワードは隠されていません。 –

答えて

2

カルロス・コルドバ(スパイダーのための開発者)によるコメントによるとduplicate but officially unanswered questionに、あなたが受けている警告がスパイダー/ QtConsoleの制限はなく、getpassです。彼はSpyderで外部端末を使うことを提案しています。

[There is no workaround] that will run inside Spyder. You can go to Run > Configuration per file > Console and select the option called Execute in an external terminal to use an external terminal instead.

関連する問題