I'm working with a csv file that's constantly growing, with about 20 lines being added per second. Each line needs to be parsed. The code snippet I have below does work, but it seems to stop updating after a bit. It's running in its own thread and if I manually update the csv file (ie. a new line every few seconds), it seems to work perfectly fine.
file=open('data.csv', 'r')
while True:
line=file.readline()
if len(line) > 2:
print(line)
#parse
This is on Ubuntu 14.04 and Python 3.5 (unfortunately, I'm stuck with these versions). Strangely enough, I haven't noticed any issues when running on Windows 7. Is there a better way to approach this?