I want to create a script with python flask or bottle module to print my /var/log/messages
logs with tail -f
command.
import subprocess
from bottle import route, response, run
@route("/")
def file():
response.content_type = "text/plain"
while True:
return subprocess.check_output(["tail", "-4", "file"])
run(host='localhost', port=888)
when i try it with tail -f
the page just hangs and loads for ever.