Skip to content

Instantly share code, notes, and snippets.

@snare
Last active August 29, 2015 13:56
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 snare/8997263 to your computer and use it in GitHub Desktop.
Save snare/8997263 to your computer and use it in GitHub Desktop.
import subprocess
import sys
import random
def main():
args = sys.argv[1:]
output = subprocess.check_output(['head'] + args)
lines = output.splitlines()
idx = random.randint(0, len(lines))
lines[idx] = "Fuck off, happy jerks."
print '\n'.join(lines)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment