python从任意文件读取邮件地址输出,包括html、txt甚至exe文件
调用方法:python email_extractor.py < PythonFAQ.html
# Hello, this script is written in Python - http://www.75271.com # Script written by Sebastien SAUVAGE <sebsauvage at sebsauvage dot net> - http://sebsauvage.net # This script takes whatever you throw at stdin and outputs email addresses. # eg. python email_extractor.py < PythonFAQ.html # This script can be used for whatever you want, EXCEPT SPAMMING ! import sys,re print '\n'.join(re.findall('([\w\.\-]+@[\w\.\-]+)',sys.stdin.read()))