I just want to count the file lines.
I have googoled around and found two ways but in vane
test = open('./log/test.csv','a')
if sum(1 for line in test) == 0:
print("no line")
shows
io.UnsupportedOperation: not readable
second way
test = open('./log/test.csv','a')
if len(test.readlines()) == 0:
print("no line")
it shows error too.