本文整理汇总了Python中mail.Mail.fetch_unread方法的典型用法代码示例。如果您正苦于以下问题:Python Mail.fetch_unread方法的具体用法?Python Mail.fetch_unread怎么用?Python Mail.fetch_unread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mail.Mail
的用法示例。
在下文中一共展示了Mail.fetch_unread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: input
# 需要导入模块: from mail import Mail [as 别名]
# 或者: from mail.Mail import fetch_unread [as 别名]
reply = input('Do you want get new unread emails from your email account? (y/n): ')[0].lower()
if reply == 'y':
usr = input('Email: ')
pwd = getpass('Password: ')
e = Mail()
success = e.login(usr, pwd)
if success:
new_emails_name = input('Enter a folder name to store new emails: ')
if platform.system() == 'Windows':
new_emails_path = current_path + new_emails_name + "\\"
elif platform.system() == 'Linux':
new_emails_path = current_path + new_emails_name + "/"
if not os.path.exists(new_emails_path):
os.mkdir(new_emails_path)
msg_uids = e.fetch_unread(new_emails_path)
knn_classify.main(dataset_name, new_emails_name, new_emails = True)
elif reply == 'n':
new_emails_name = input('Enter the name of new emails folder: ')
knn_classify.main(dataset_name, new_emails_name, new_emails = True)
else:
print('Invalid Input.')
elif choice2 == 4:
break
else:
print('Invalid choice.')
elif choice == 3: