应用场景:用来检测网站可用性,访问失败,则发邮件通知 #!/usr/bin/env python import urllib2,time,smtplib,string,logging from conf import * logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', datefmt='%a, %d %b %…