Q:

python password script

import stdiomask

stdiomask.getpass(prompt = 'Password: ')
2
# A simple Python program to demonstrate  
# getpass.getpass() to read password 
import getpass 
  
try: 
    p = getpass.getpass() 
except Exception as error: 
    print('ERROR', error) 
else: 
    print('Password entered:', p) 
0
import sys

def main():

	print '\nPassword Request Program v.01\n'
	
	password = 'abcd'
	user_input = raw_input('Please Enter Password: ')
	
	if user_input != password:
		sys.exit('Incorrect Password, terminating... \n')
		
	print 'User is logged in!\n'
	
if __name__ == "__main__":
	main()
0

New to Communities?

Join the community