testre
import re fileName = input() myre=re.compile(r"^(\w+)(\.\w+)*@(\w+)((\.\w+)+)$") file=open(fileName, 'r') for line in file: t = myre.findall(line) if t: print(line)
import re fileName = input() myre=re.compile(r"^(\w+)(\.\w+)*@(\w+)((\.\w+)+)$") file=open(fileName, 'r') for line in file: t = myre.findall(line) if t: print(line)