
Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
8 lines
142 B
Python
8 lines
142 B
Python
b = bytearray(30)
|
|
f = open("io/data/file1", "rb")
|
|
print(f.readinto(b))
|
|
print(b)
|
|
f = open("io/data/file2", "rb")
|
|
print(f.readinto(b))
|
|
print(b)
|