The Freeman Law Firm, P.C.
Free Consultations
At The Freeman Law Firm in Texas, we offer the best of both worlds. We offer the strength, experience and resources expected of a large firm with the personal service expected of a small firm.
Do you have a case? Click to contact us today.def extract_emails_from_file(filepath): try: with open(filepath, 'r', encoding='utf-8') as file: content = file.read() return extract_emails(content) except FileNotFoundError: print(f"File not found: {filepath}") return []
def main(): source = input("Enter text or file path: ") if source.endswith('.txt'): emails = extract_emails_from_file(source) else: emails = extract_emails(source)
print("\nExtracted emails:") for email in set(emails): # Remove duplicates print(email) if == " main ": main()