circuitpython/tests/io/file_readline.py
Scott Shawcroft b057fb8a4b
codeformat
2021-04-19 22:22:44 -07:00

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()