8月 232022
 

使用下面的代码读取mysql数据时出现TypeError: tuple indices must be integers or slices, not str错误

获取cursor时未指定cursor类型,默认使用tuple类型返回,将cur = conn.cursor()这一行修改为如下就可以了

 

打赏
 Posted by on 2022-08-23

Sorry, the comment form is closed at this time.