Пытаюсь найти bytes в bytes через bisect, однако не работает.
from bisect import bisect_left
def main():
fdump = open('test.bin','rb')
dump = fdump.read(100) # размер файла 100 байт
fdump.close()
stroka = 'Строка в cp1251'
brow = bytes(stroka, 'cp1251')
pos = bisect_left(dump, brow) # Здесь вываливается ошибка TypeError: unorderable types: int() < bytes()
if (pos != hi and a[pos] == x):
print("OK")
else:
print("FAIL")
if __name__ == '__main__':
main()
pos = bisect_left(dump, brow)
if (pos != hi and a[pos] == x):
Питон 3.2.1(Win)