Skip to content

Instantly share code, notes, and snippets.

@minhaz1
Created September 24, 2017 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minhaz1/e5370970175e4cde4d1f06f3400d04fe to your computer and use it in GitHub Desktop.
Save minhaz1/e5370970175e4cde4d1f06f3400d04fe to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
def tail(filename):
f = open(filename)
while True:
pos = f.tell()
line = f.readline()
if not line:
f.seek(pos)
else:
print line,
if __name__ == '__main__':
tail(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment