Advertisement
Guest User

Untitled

a guest
Aug 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. def createUser():
  2.  
  3. """
  4. check usernames doesn't already exist
  5. check passwords inputs are the same
  6. and basic password strength test e.g. length, numbers, specail chars
  7. invalid chars not in data? might not be needed
  8. """
  9. NewUser=raw_input("Type your user name >>>")
  10.  
  11. if UserExists(NewUser):
  12. Password=getpass.getpass("Type your password >>>")
  13. PasswordC=getpass.getpass("Confirm your password >>>")
  14. if Password==PasswordC:
  15. for index in range(len(Password)):
  16. if Password[index] in ALL:
  17. passwordSafe = True
  18. else:
  19. passwordSafe = False
  20. if passwordSafe:
  21. UsernamePsw=str("\n"+NewUser+","+Password)
  22. FileOpen=open("users.csv","a")
  23. FileOpen.write(UsernamePsw)
  24. FileOpen.close()
  25. Login()
  26. createUser()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement