You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
367 B

f = open("io/data/file1", "rb")
print(f.seek(6))
print(f.read(5))
print(f.tell())
print(f.seek(0, 1))
print(f.read(4))
print(f.tell())
print(f.seek(-6, 2))
print(f.read(20))
print(f.tell())
print(f.seek(0, 0))
print(f.read(5))
print(f.tell())
f.close()
# test text mode
f = open("io/data/file1", "rt")
print(f.seek(6))
print(f.read(5))
print(f.tell())
f.close()