You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
15 lines
276 B
Python
15 lines
276 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)
|
|
|
|
# readinto() on writable file
|
|
f = open('io/data/file1', 'ab')
|
|
try:
|
|
f.readinto(bytearray(4))
|
|
except OSError:
|
|
print('OSError')
|