circuitpython/tests/io/file_readline.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
261 B
Python
Raw Normal View History

f = open("io/data/file1")
print(f.readline())
print(f.readline(3))
print(f.readline(4))
print(f.readline(5))
print(f.readline())
2015-12-23 17:37:02 -05:00
# readline() on writable file
2021-03-15 09:57:36 -04:00
f = open("io/data/file1", "ab")
2015-12-23 17:37:02 -05:00
try:
f.readline()
except OSError:
2021-03-15 09:57:36 -04:00
print("OSError")
2015-12-23 17:37:02 -05:00
f.close()