Difference between revisions of "Python/UserPasswords"
From ProgrammingExamples
< Python
(→UserPasswords.py) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==UserPasswords.py== | ==UserPasswords.py== | ||
+ | [[Python|<font size='-2'>''back to Python examples''</font>]] | ||
+ | ---- | ||
<source lang="python"> | <source lang="python"> | ||
import getpass | import getpass | ||
+ | |||
username = str(raw_input("Username: ")) | username = str(raw_input("Username: ")) | ||
Line 7: | Line 10: | ||
print("Your username is %s and your password is %s" % (username, password)) | print("Your username is %s and your password is %s" % (username, password)) | ||
+ | </source><br> | ||
+ | ---- | ||
+ | [[Python|<font size='-2'>''back to Python examples''</font>]] |
Latest revision as of 09:30, 27 June 2010
UserPasswords.py
import getpass username = str(raw_input("Username: ")) password = getpass.getpass("Password: ") #You will see that the password won't show on your screen print("Your username is %s and your password is %s" % (username, password))