I get an error: TypeError: Required argument 'source' (pos 1) not found
but I haven't got a clue what it means :/. Can anyone put me on the right track?
My code is:
def openFile(self,fileName):
email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b', re.IGNORECASE)
with open(fileName) as lijstEmails:
self.FinalMailsArray.append([email_pattern.findall() for line in lijstEmails])
self.writeToDB()
Basically it opens a number files in a directory, reads them and then goes looking for email addresses and writes them to a database.