Created
May 14, 2015 22:43
-
-
Save piersolenski/bb2dc8176b0f21281742 to your computer and use it in GitHub Desktop.
Make Ray's computer say funny shit via UDP
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
import socket | |
import argparse | |
import subprocess | |
if __name__ == "__main__": | |
p = argparse.ArgumentParser() | |
p.add_argument("port", type=int) | |
args = p.parse_args() | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind(("0.0.0.0", args.port)) | |
while True: | |
data, addr = sock.recvfrom(1024) | |
subprocess.call(["say -v Zarvox %s" % (data)], shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment