How to streamingly read text file and display whenever updated text

Mark Lawrence breamoreboy at yahoo.co.uk
Sat Oct 5 04:14:48 EDT 2013


On 05/10/2013 09:06, James Harris wrote:
> <galeomaga at gmail.com> wrote in message
> news:04ee91f9-1cbf-4364-bca3-da25aa4db45f at googlegroups.com...
>>
>>
>> #!/usr/bin/python
>> import time
>> f = open('/home/martin/Downloads/a.txt')
>
> Looks like you are on Unix so you can do this from the shell
>
>    tail -F /home/martin/Downloads/a.txt
>
> James
>
>

Tail also works on Windows if you've unxutils installed :)

-- 
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.

Mark Lawrence




More information about the Python-list mailing list