本文整理汇总了Python中sender.Sender.createMsg方法的典型用法代码示例。如果您正苦于以下问题:Python Sender.createMsg方法的具体用法?Python Sender.createMsg怎么用?Python Sender.createMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sender.Sender
的用法示例。
在下文中一共展示了Sender.createMsg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from sender import Sender [as 别名]
# 或者: from sender.Sender import createMsg [as 别名]
print('当前开放课程: ')
for course in ryan_helper.courseNames:
print(course)
print('##############')
### End checking ###
detect = False
while not detect:
try:
last = ryan_helper.courseNames
time.sleep(4) # check every four seconds
ryan_helper.update_names()
cur = ryan_helper.courseNames
if last != cur:
sender.createMsg(body = "课程已更新,\n %s" %(str(cur)) , subject = '选课提醒')
sender.sendmail()
for course in wanted_course:
res = ryan_helper.check(course)
if res:
print("%s : 开放" %(course))
# send you an email if the course you wanted is open for selection.
sender.createMsg(body = "%s 已开放" %(course), subject = '选课提醒')
sender.sendmail()
detect = True
else:
print("%s : 未开放" %(course))
except Exception as e:
ryan_helper = Course_enrollment()
ryan_helper.update_names()