I am new to Python but not other programming languages.
What is the condition being tested for in the while loop in the following snippet.
What is byte being compared to so that the condition is True?
Or to ask it another way, what happens to byte when the end of the file is reached?
What is the condition being tested for in the while loop in the following snippet.
What is byte being compared to so that the condition is True?
Or to ask it another way, what happens to byte when the end of the file is reached?
with open("myfile", "rb") as f: byte = f.read(1) while byte: # Do stuff with byte. byte = f.read(1)