Advertisement
Salaamm

Login

Jan 31st, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. import re
  2.  
  3. # This is the class that reads in the user's credentials:
  4. class InputReader():
  5.   def __init__(self):
  6.     self.username = ""
  7.     self.password = ""
  8.     self.credentials = ""
  9.  
  10.   def readInput(self):
  11.     self.username = raw_input("Username: ")
  12.     self.password = raw_input("Password: ")
  13.     self.credentials = self.username + ", " + self.password
  14.  
  15.   def getCredentials(self):
  16.     return self.credentials
  17.  
  18.  
  19. class CredentialWriter(InputReader):
  20.     def __init__(self):
  21.         self.checker = r"(\d, '%', '^', '&')"
  22.         re.findall( self.checker, self.username )
  23.         re.findall( self.checker, self.password )
  24. # Create a new InputReader named ir.
  25. ir = InputReader()
  26.  
  27. # Run the readInput function to get the user's credentials.
  28. ir.readInput()
  29.  
  30. # Print out the username and password separated by a comma.
  31. print ir.getCredentials()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement