Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login():
- username = str(input("Please enter your username to login: "))
- password = str(input("Please enter your password to login: "))
- joint =(username+password)
- message = hashPW(joint)
- s.send(message.encode())
- ls = s.recv(1024)
- print(ls)
- while ls != "Login successfull":
- login()
- else:
- after_choice()
- def recive():
- global password
- password = c.recv(1024).decode()#reciving the password
- print("Password from client: ", password)
- PWcheck()
- def PWcheck():
- f= open("passwords.txt")
- f1=f.readlines()
- if password in f1:
- print("Login successfull")
- ls =("Login successfull")
- c.send(ls.encode())
- wait() #just the next class
- else:
- print("Username or password incorrect")
- ls =("Username or password incorrect")
- c.send(ls.encode())
- recive()
Add Comment
Please, Sign In to add comment