Background: I have a large file and I want to read the first few values from it. I don't really want to read the entire file partly since I have no further use for it, so that it does not use unnecessary memory and is faster to execute (since it does not need to read this huge file).
From the documentation I am using:
test.txt
Greetings World :)
test.py:
with open('test.txt', buffering=3) as file:
a = file.read()
print(a)
It does not only partly read my file.
Is there a way to only read part of a file?