Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- # This is the class that reads in the user's credentials:
- class InputReader():
- def __init__(self):
- self.username = ""
- self.password = ""
- self.credentials = ""
- def readInput(self):
- self.username = raw_input("Username: ")
- self.password = raw_input("Password: ")
- self.credentials = self.username + ", " + self.password
- def getCredentials(self):
- return self.credentials
- class CredentialWriter(InputReader):
- def __init__(self):
- self.checker = r"(\d, '%', '^', '&')"
- re.findall( self.checker, self.username )
- re.findall( self.checker, self.password )
- # Create a new InputReader named ir.
- ir = InputReader()
- # Run the readInput function to get the user's credentials.
- ir.readInput()
- # Print out the username and password separated by a comma.
- print ir.getCredentials()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement