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
261 B
Python
15 lines
261 B
Python
f = open("io/data/file1")
|
|
print(f.readline())
|
|
print(f.readline(3))
|
|
print(f.readline(4))
|
|
print(f.readline(5))
|
|
print(f.readline())
|
|
|
|
# readline() on writable file
|
|
f = open('io/data/file1', 'ab')
|
|
try:
|
|
f.readline()
|
|
except OSError:
|
|
print('OSError')
|
|
f.close()
|