Advertisements
Advertisements
Question
In how many ways can end of file be detected?
Very Short Answer
Advertisements
Solution
The end of a text file can be detected in two common ways:
read(),readline()or iteration returns an empty string.- While reading a binary pickle file,
pickle.load()raisesEOFError.
shaalaa.com
Is there an error in this question or solution?
