1.python 2.78 发邮件
import smtplib
from email.mime.text import MIMEText
_user = "12345@163.com"
_pwd = "12345"
_to = "12345@qq.com"
#使用MIMEText构造符合smtp协议的header及body
msg = MIMEText("hello,world")
msg["Subject"] = "don't panic"
msg["From"] = _user
msg["To"] = _to
s = smtplib.SMTP("smtp.163.com", timeout=30)#连接smtp邮件服务器,端口默认是25
s.login(_user, _pwd)#登陆服务器
s.sendmail(_user, _to, msg.as_string())#发送邮件
s.close()
2.time
import time
while True:
currentms=time.strftime('%M%S',time.localtime(time.time()))
print currentms
time.sleep(1)
if(currentms=='1830'):
print "dfdfdfdfd"
exit()