我收到一个错误:TypeError: Required argument 'source' (pos 1) not found
但我不知道这意味着什么:/。谁能让我走上正轨?我的代码是:
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()
基本上,它会在目录中打开一个数字文件,读取它们,然后查找电子邮件地址并将它们写入数据库。