micropython: add micropython component
This commit is contained in:
14
components/language/micropython/tests/io/file_readinto.py
Normal file
14
components/language/micropython/tests/io/file_readinto.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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")
|
Reference in New Issue
Block a user