ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Imitating "tail -f"
by Wolodja Wentland other posts by this author
Nov 22 2009 1:14AM messages near this date
Imitating "tail -f" | Re: Imitating "tail -f"
On Sun, Nov 22, 2009 at 03:43 +0100, Ivan Voras wrote:
>  I'm trying to simply imitate what "tail -f" does, i.e. read a file, wait
>  until it's appended to and process the new data, but apparently I'm
>  missing something.
[..]
>  Any advice?

Have a look at [1], which mimics "tail -f" perfectly. It comes from a
talk by David Beazley on generators which you can find at [2] and
[3].

Enjoy!

[1] http://www.dabeaz.com/generators/follow.py
[2] http://www.dabeaz.com/generators-uk/
[3] http://www.dabeaz.com/coroutines/

-- 
  .''`.     Wolodja Wentland    <wentland@[...].de>  
 : :'  :    
 `. `'`     4096R/CAF14EFC 
   `-       081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC
Thread:
Ivan Voras
Wolodja Wentland
Paul Boddie
exarkun
Aahz
Nobody
Paul Rudin
exarkun
Jason Sewall
Matt Nordhoff

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved