Skip to content

Instantly share code, notes, and snippets.

@thomasballinger
Last active December 14, 2015 01:58
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 thomasballinger/5009922 to your computer and use it in GitHub Desktop.
Save thomasballinger/5009922 to your computer and use it in GitHub Desktop.
A say that follows better unix conventions!
#!/usr/bin/env python
from subprocess import Popen
import sys
def say_blocking(msg):
p = Popen(['say', msg])
p.communicate()
while True:
line = sys.stdin.readline()
if line == '':
break
say_blocking(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment