TypeError: object of type ‘Cursor‘ has no len()


When using pymysql, the find() function returns a query result of type cursor
at that time, it was thought that what was returned was a list, so the len() function was directly used to calculate the length in the following loop. But an error is reported, such as the title information, which means that the returned data is of cuesor type, and the len() function is not supported.


Use. Rowcount

Read More: