Last active
December 14, 2015 01:58
-
-
Save thomasballinger/5009922 to your computer and use it in GitHub Desktop.
A say that follows better unix conventions!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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