updated to python 3
Title: Update code to Python 3 compatibility
Description:
This PR updates the email wildcard lookup script to be compatible with Python 3. Key changes include:
- Changed shebang to
#!/usr/bin/env python3for better portability. - Imported
urllib.requestasurllib2to keep consistent variable names. - Updated exception handling syntax (
Exception, etoException as e). - Implemented
f-stringformatting for better string manipulations. - Used context managers (
with) to handle file operations which ensures proper file closing and exception handling. - Updated file opening in "append" mode with line buffering for improved efficiency.
These changes make the script more readable and ensure it will run correctly in a Python 3 environment.
Please review the changes and let me know if there are any concerns or further modifications needed.
Thanks for doing this update. I honestly didn't know people used this script.
Unfortunately, I think you may need to make more edits for the script to be Python 3 ready AND to work. I'm wondering if you were able to test it after making these updates? I ask because it appears the URL in line 42 no longer works. Perhaps it needs HTTPS?