I saw a piece of code, as follows:
with open(‘text.txt’,‘r’)as fp:
while True:
data_line=fp.readline()
if data_line:
print(data_line)
writing data in txt,and all the time python will keep outputting.
I think this code is great.
But I don't quite understand the line if data_line:
I hope someone can explain it, thanks.