I'm reading in serial data from a serial USB device with python. I want to compare the received data with a predefined string if it matches. Reading the data works fine the problem is this if-statement:
if serialInst.in_waiting:
startPacket = serialInst.readline()
z = "iohioowwcncuewqrte"
k = startPacket.decode('utf').rstrip('\n')
if (k == z):
print("right passkey")
else:
print("Error")
exit()
Thank you in advance.