Skip to content

Instantly share code, notes, and snippets.

@sunhwan
Created July 24, 2012 15:09
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 sunhwan/3170565 to your computer and use it in GitHub Desktop.
Save sunhwan/3170565 to your computer and use it in GitHub Desktop.
remote tail
import subprocess as sp
pid = sp.Popen(['ssh', 'purdue', 'tail -f work/glycan/benchmarks/rexmd/aarex/server.log'], stdin=sp.PIPE, stdout=sp.PIPE, close_fds=True)
stdin, stdout = pid.stdin, pid.stdout
while 1:
print stdout.readline()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment