Any idea to emulate tail -f
J Kenneth King
james at agentultra.com
Tue May 5 12:18:00 EDT 2009
Iain King <iainking at gmail.com> writes:
> On May 5, 7:00 am, Joel Juvenal Rivera Rivera <joel... at gmail.com>
> wrote:
>> I want to make something very similar to the command tail -f (follow a
>> file), i have been trying with some while True and some microsleeps
>> (about .1 s); did someone has already done something like this?
>>
>> And about the file is the apache acceslog of a site with a lot of
>> traffic.
>>
>> Regards
>>
>> joe / Joel Rivera
>
> This is very interesting, about using Generator Expressions:
> http://209.85.229.132/search?q=cache:ZHrV4E0eTI8J:www.dabeaz.com/generators/Generators.pdf
>
> Relevant stuff about 'tail -f' is on page 39, but I'd read the whole
> thing if you can.
>
> Iain
+1
I second this suggestion. I've used this method in many scripts of
late and it is quite handy.
He even takes it a little further and shows you some neat things you
can do with it later on.
More information about the Python-list
mailing list