python从任意文件读取邮件地址输出的代码

如下的资料是关于python从任意文件读取邮件地址输出的代码。
# 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()))




 

posted @ 2019-02-08 09:06  玉米帮  阅读(367)  评论(0编辑  收藏  举报