0

I want to parse a file to look for a word in it. I have to parse the file on the go. For e.g. a log file is created and modified by a software and at the same time I need to look for 'error'(for example) word in it.

The way I am doing right now is that I am parsing it periodically like polling. I hope there must be some way to make it efficient something like interrupts

Thanks

user2793078
  • 419
  • 7
  • 12
  • Similar question asked here.. http://stackoverflow.com/questions/182197/how-do-i-watch-a-file-for-changes-using-python – neau Aug 18 '15 at 19:31
  • select may help https://docs.python.org/2/library/select.html . on consideration that's probably what you use as you write about polling... – hiro protagonist Aug 18 '15 at 19:35

0 Answers0