我想使用Python脚本将字符串存储到数据库中。但是运行代码时,我遇到了错误:“无法连接'str'和'NoneType'对象”。
如何解码这个字符串“Poste Si\xe8ge”,以便成功存储?
insert="INSERT INTO blacklist VALUES(INET_ATON('"+ long2ip(row[0]) +"'),NOW(),'"+ check.country +"',4,' ','"+detect[0]+"','"+ispTarget[0]+"')"
detect[0]=Poste Si\xe8ge
TypeError: cannot concatenate 'str' and 'NoneType' objects
请帮帮我
+
),但实际上未设置。能否提供更多代码来帮助你? - Jaaycheck.country
、detect[0]
和ispTarget[0]
的值。 - Jaay