1、Python中’Nonetype’ object is not iterable的问题
None 值被赋给了多个变量,如下
a, b = None
该对象的值为None,可能被赋值的时候出现问题(源数据为None)
*当一个函数没有return语句,函数会返回None,此时如果将函数返回值赋给多个变量,则容易出现上述错误。
2、TypeError: can’t compare datetime.date to NoneType
3、Warning: Data truncated for column ‘end_collect_time’ at row 1
end_collect_time值类型与数据库中的值的类型不匹配
4、(1064, “You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 1”)
sql 语法错误,sql中某个条件为空了
例如:where id in ()
5、(1054, “Unknown column ‘None’ in ‘field list’”)
往数据库中插入数据的时候,某些数据为Nonde
6、函数在没有返回值时 默认返回None
7、Warning: Data truncated for column ‘end_collect_time’ at row 1
cursor_test.execute(sql_insert)
由于插入的数据格式与数据库中的数据格式不匹配造成的
追问麻烦问下怎么解决
本回答被网友采纳