I try to stock string in my database with python script. But but when running the code I have this error cannot concatenate 'str' and 'NoneType' objects.
How can i decode this string "Poste Si\xe8ge" to be stocked successfully
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
Help me plz
Did you try str()
in-built function.?
If you concatenate string objects with other data types, then the other type has to be converted to str(other_data_type)
Hope this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With