import _io fio = _io.FileIO(0) buf = bytearray(128) print(fio.readinto(buf)) print(repr(buf)) #if buf[0] == 0: # while True: # pass #print('end')