Mike Brown wrote: > In my use case, I need to send the results of a command-line script to stdout > after the user authenticates, and the user may be redirecting stdout, so I > don't want the password prompt to pollute the output. If I could have the > "Password: " show up in stderr, that would be ideal. you can redirect sys.stdin/sys.stdout before you call getpass: try: old_stdout = sys.stdout sys.stdout = sys.stderr password = getpass.getpass(prompt) finally: sys.stdout = old_stdout </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4