1、python3访问mysql数据库,报错
TypeError:%d format: a number is required, not str

原因:port不是int类型,mysql_port的需要填一个int而不是str类型的
解决方法:将port='3306'转换成int类型,即 port=int('3306')

2、编写自动检测邮箱是否收到新邮件程序时遇到的问题
imaplib.IMAP4.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED

解决方法:参考https://blog.csdn.net/iteye_13695/article/details/82679570
在http://config.mail.163.com/settings/imap/index.jsp?uid=YOUR_EMAIL_NAME@126.com中进行绑定手机号的配置即可
网友评论