X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_lib%2Fmcrypt.py;h=03aa7f6f8d0937d4407de5ed3828031690b914f4;hb=fea5b1d068bc94adce899a804a643bf24b8a9777;hp=acbead1f3f3426dcf8437597d39730977028302f;hpb=8d79317cdc8220ff3c2192e68fc1dfc749c3ea1c;p=m_lib.git diff --git a/m_lib/mcrypt.py b/m_lib/mcrypt.py index acbead1..03aa7f6 100755 --- a/m_lib/mcrypt.py +++ b/m_lib/mcrypt.py @@ -5,6 +5,7 @@ # +from __future__ import print_function import random, crypt @@ -32,17 +33,16 @@ def test(): pwd_file = open("test.pwd", 'w') pwd_file.write("%s:%s" % ("user", encrypted)) pwd_file.close() - print "Password file written" + 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): - print "Password verified Ok" + print("Password verified Ok") else: - print "BAD password" + print("BAD password") if __name__ == "__main__": test()