All Projects → kasun → Python Tail

kasun / Python Tail

Unix tail follow implementation in python

Programming Languages

python
139335 projects - #7 most used programming language

python-tail - Unix tail follow implementation in Python

Installation

python setup.py install

Basic Usage

import tail

# Create a tail instance
t = tail.Tail('file-to-be-followed')

# Register a callback function to be called when a new line is found in the followed file. 
# If no callback function is registerd, new lines would be printed to standard out.
t.register_callback(callback_function)

# Follow the file with 5 seconds as sleep time between iterations. 
# If sleep time is not provided 1 second is used as the default time.
t.follow(s=5)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].