0

Below code will read from multiple files and print, and after printing it stops execution. However multiple processes will be adding data to these files at an interval.

How to keep monitoring these files and read for longer duration ?

import glob
list_of_files=glob.glob('./*.txt')

for filename in list_of_files:
    f=open(filename, "r")
    data_list=f.readlines()
    print(data_list)
PRMoureu
  • 12,817
  • 6
  • 38
  • 48

0 Answers0