i have a problem with a string. This is the code:
if x.find("Sensor")!=-1 :
The error that comes out to me is the following:
if x.find("Sensor")!=-1 :
TypeError: argument should be integer or bytes-like object, not 'str'
I think I need to convert the string to binary. Do you have any idea how to do it?
Thank you all
xcontains a byte string object. So, you should passx.find(b"Sensor")byte string as a parameter of thefindmethod. Your current condition will work only on a string.