Below is my code, I am using :
with open(r'C:\Users\Manish\Desktop\File5.txt', 'r') as f:
fo = f.read(20)
print(fo)
f.seek(20,1)
fo = f.read(20)
print(fo)
But instead of getting next lines from current position, it repeatedly showing me error. Where is the problem in my code ?
It seems like offset from current stream and end of stream only supported in binary mode. Which you have to open the file with
open(r'C:\Users\Manish\Desktop\File5.txt', 'rb')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With