Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@insom
Created July 14, 2011 21:53
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 insom/1083554 to your computer and use it in GitHub Desktop.
Save insom/1083554 to your computer and use it in GitHub Desktop.
Cycle through a series of stdin lines, updating iChat status.
#!/usr/bin/python
# For best results: pip install appscript
__author__ = "Aaron Brady <bradya@gmail.com>"
__copyright__ = "Copyright 2011, Aaron Brady, Interactive Web Solutions Ltd."
__license__ = "MIT"
from appscript import app
from time import sleep
from sys import stdin, argv
ic = app("iChat")
lines = stdin.readlines()
while True:
for line in lines:
ic.status_message.set(line.strip())
sleep(int(len(argv) > 1 and argv[1] or 10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment