Skip to content

Instantly share code, notes, and snippets.

@dmoney
Created June 29, 2018 04:42
Show Gist options
  • Save dmoney/f60f0614eed40eed53728bcfd5fe0a63 to your computer and use it in GitHub Desktop.
Save dmoney/f60f0614eed40eed53728bcfd5fe0a63 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys, os
def alert():
os.system('say -v Tessa "Your task has been completed."')
def alert_on_pipe_close():
try:
while True:
text = sys.stdin.read()
if text == '':
sys.stdout.flush()
break
sys.stdout.write(text)
finally:
alert()
if __name__ == '__main__':
alert_on_pipe_close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment