kopia lustrzana https://github.com/micropython/micropython-lib
Added README and test_chunk
rodzic
77255dc11e
commit
dfa05a4771
|
@ -0,0 +1,7 @@
|
||||||
|
# Chunk
|
||||||
|
|
||||||
|
Imported `chunk.py` from the CPython stdlib at version
|
||||||
|
ac7b1a3f32cc81520e8962352294006d65744028.
|
||||||
|
|
||||||
|
`test_chunk.py` was created as a simple test to chunkify the MicroPython logo
|
||||||
|
(in tiff format) and ensure chunk didn't obviously fail.
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,18 @@
|
||||||
|
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)
|
Ładowanie…
Reference in New Issue