Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / core / examples / filewatch.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 #
5 from twisted.application import internet
6
7 def watch(fp):
8     fp.seek(fp.tell())
9     for line in fp.readlines():
10         sys.stdout.write(line) 
11
12 import sys
13 from twisted.internet import reactor
14 s = internet.TimerService(0.1, watch, file(sys.argv[1]))
15 s.startService()
16 reactor.run()
17 s.stopService()