Skip to content Skip to sidebar Skip to footer

"getpasswarning: Can Not Control Echo On The Terminal" When Running From Idle

When I run this code: import getpass p = getpass.getpass(prompt='digite a senha\n') if p == '12345': print('YO Paul') else: print('BRHHH') print('O seu input foi:', p) # p

Solution 1:

Use an actual terminal -- that is, an environment where stdin, stdout and stderr are connected to /dev/tty, or another PTY-compliant device.

The IDLE REPL does not meet this requirement.

Solution 2:

Run your code in terminal, instead of the IDE. you will see that there is no more warning there. To run your code, enter this command in terminal:

python3 your_program.py

Solution 3:

Rather than deal with changing the current working directory in a terminal that has not started Python (which would mean you type something like python3 script.py--and it will fail unless the current working directory is already specified), start Python in your terminal and run this one-line command:

exec(open('C:\folder\script.py').read())

where you change the path string 'C:\folder\script.py' to match wherever your file is located on disk (the string does need to be specified with quotes).

Solution 4:

use cmd ie. command prompt and then run the file in it.

like:

python abc.py

Post a Comment for ""getpasswarning: Can Not Control Echo On The Terminal" When Running From Idle"