Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cred(username,password,confpassword):
- Uusername=str(raw_input(username))
- Ppassword=str(raw_input(password))
- password_hash=hashlib.md5(Ppassword.encode())
- Ppassword=password_hash.hexdigest()
- Cconfpassword=str(raw_input(confpassword))
- Cconfpassword_hash=hashlib.md5(Cconfpassword.encode())
- Cconfpassword=Cconfpassword_hash.hexdigest()
- New_Password_hash =str()
- if Ppassword!=Cconfpassword :
- while Ppassword!=Cconfpassword:
- print("Not match")
- New_Password=str(raw_input("confirm password again: "))
- New_Password_hash=hashlib.md5(New_Password.encode())
- New_Password=New_Password_hash.hexdigest()
- if New_Password_hash.hexdigest()==password_hash.hexdigest():
- print("Match")
- break
- creds=["username: ","\npassword: ","\nconfpass: " ," \n ","\n"]
- creds.insert(1,Uusername)
- creds.insert(3,password_hash.hexdigest())
- creds.insert(5,New_Password_hash.hexdigest())
- print(creds)
- with open("UsersANDpass.txt","a")as f:
- for word in creds:
- f.write(word)
- else:
- print "Thank you!"
- creds=["username: ","\npassword: ","\nconfpass: " ," \n ","\n"]
- creds.insert(1,Uusername)
- creds.insert(3,password_hash.hexdigest())
- creds.insert(5,Cconfpassword_hash.hexdigest())
- with open("UsersANDpass.txt","a")as f:
- for word in creds:
- f.write(word)
- def OpenFolder(Folpath,Folname):
- getFolpath=str(raw_input(Folpath))
- getFolname=str(raw_input(Folname))
- os.mkdir(Folpath+"\\"+Folname)
- def main():
- inserttolist=cred(username="user: ",password="pass: ",confpassword="confp: ")
- creds=["username: ","\npassword: ","\nconfpass: " ," \n ","\n"]
- print(creds[1])
- print("Welcome to the Shortcater")
- print("1.To open a new folder")
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment