circuitpython/tests/io/file1.py
stijn a3efe04dce Use mode/encoding kwargs in io and unicode tests
mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8
2014-10-21 22:10:38 +03:00

15 lines
342 B
Python

f = open("io/data/file1")
print(f.read(5))
print(f.readline())
print(f.read())
f = open("io/data/file1")
print(f.readlines())
f = open("io/data/file1","r")
print(f.readlines())
f = open("io/data/file1","rb")
print(f.readlines())
f = open("io/data/file1",mode="r")
print(f.readlines())
f = open("io/data/file1",mode="rb")
print(f.readlines())