Jun-11-2020, 07:37 PM
Load is a bytes object and your keyword are strings. Those can't be directly compared.
>>> load = b"bytes object with ascii data" >>> "with" in load Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: a bytes-like object is required, not 'str'If the data you captured was UTF-8, you could decode it to a str, or you could have your list of matching keywords as bytes. Either might make sense.
>>> b"with" in load True >>> "with" in load.decode() True