micropython-lib/python-stdlib/chunk/test/test_chunk.py

19 wiersze
387 B
Python
Czysty Zwykły widok Historia

2021-09-10 12:51:03 +00:00
from chunk import Chunk
from micropython import const
logo = open("micropython-logo.tiff", "rb")
CHUNK_SIZE = const(23) # Arbitrary size
while True:
try:
chunk = Chunk(logo)
except EOFError:
break
chunktype = chunk.getname()
while True:
data = chunk.read(CHUNK_SIZE)
if not data:
break
print(data)