If I get the content of a file with ret = os.read(fd, os.path.getsize(file))
, how do I check if ret
contains a specific string, for example "hello world"
?
An answer on here was simply if "hello world" not in ret:
, but this does not work anymore in python 3.4, apparently (Because of mixing bytes with unicode or something). How do I do this now?