Increase the data file is a real-time dynamic, need real-time statistics in data increase file data lines, a great god please what method
CodePudding user response:
n=0every 2 seconds to print a line number.
Pos=0
With the open (' z:/TMP. TXT) as f:
While True:
Time. Sleep (2)
F.s eek (pos)
N +=len (f.r eadlines ())
Print (n)
Pos=f.t ell ()