python TypeError: unsupported operand type(s) for +: 'int' and 'str' [closed]


TypeError: unsupported operand type(s) for +: 'int' and 'str' [closed]

 

sql="insert into auto_transfer_data(atd_type,atd_mogodb_count,atd_mysql_before_count,atd_create_date)values('"+at_type+"','"+str(mongodbcount)+"','"+str(mysql_before_count)+"','"+currentDate+"')"

解决办法 类型转换
int转成string,函数str(number)
string转成int,函数int(string)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM