a3efe04dce
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
15 lines
342 B
Python
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())
|