On Jun 22, 2:50 pm, "Kenji Noguchi" <[EMAIL PROTECTED]> wrote: > something like this? unix tail command does more fancy stuff > like it waits for timeout, and check if the file is truncated > or depending on incoming data it sleeps seconds , etc etc. > > #!/usr/bin/env python > import sys, select > > while True: > ins, outs, errs = select.select([sys.stdin],[],[]) > for i in ins: > print i.readline()
select doesn't work on regular files (only pipes/sockets/etc). inotify is platform-specific; the portable way to do this is to poll, like tail does. If you know you're on a platform that has inotify or something like it, it's probably the more efficient (and lower latency) route to go. -- http://mail.python.org/mailman/listinfo/python-list