def test():
+ try:
+ raw_input
+ except NameError: # Python 3
+ raw_input = input
+
passwd = raw_input("Enter password: ")
salt = gen_salt()
encrypted = crypt.crypt(passwd, salt)
pwd_file.close()
print("Password file written")
- import string
pwd_file = open("test.pwd", 'r')
- username, encrypted = string.split(pwd_file.readline()[:-1], ':')
+ username, encrypted = pwd_file.readline()[:-1].split(':')
pwd_file.close()
if crypt.crypt(encrypted, encrypted):