I need help with a password issue.
I'm trying to create a simple password program, but the problem I am having is that I cannot replace the input with '*'s without importing anything.
Does anyone have any solutions?
I need help with a password issue.
I'm trying to create a simple password program, but the problem I am having is that I cannot replace the input with '*'s without importing anything.
Does anyone have any solutions?
import getpass
password = getpass.getpass('Password:')
Note that getpass is a part of the standard library.
But if you are not doing any imports then you have a big problem as the only other ways all involve control of the terminal such as getting each key and replacing the output with * but that sort of control of the terminal is itself an import.
If you really can't do imports, then do this:
Enter the python directory in your computer, search for the getpass module, open the source code and search for the getpass function/class/whatever, copy-paste It in your code, Done.