0

I have been searching for quite some time, trying to find how to mask terminal OUTPUT.

Example:

print(password)
terminal:
********

But still be able to copy and paste the password value.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Moh682
  • 793
  • 1
  • 7
  • 11
  • This could help: https://stackoverflow.com/a/35805111/4045754 – yeniv Sep 15 '19 at 14:37
  • Not really. You see getPass masks the input value. What i want is to mask the output value while still being able to copy and paste it somewhere else – Moh682 Sep 16 '19 at 15:13

1 Answers1

0

There doesn't seem to be an answer to this. I have asked around :(

I worked around this problem. The goal was to be able to put the password in the clipboard. So I used Pyperclip to do it :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Moh682
  • 793
  • 1
  • 7
  • 11
  • The reason it can't be done as described is because the system that handles selecting text in a terminal and copying it has no way to know about the "hidden" characters; it's operating completely independently of your program. – Karl Knechtel Aug 03 '22 at 03:29