Skip to content

Instantly share code, notes, and snippets.

@91bananas
Created September 21, 2017 16:02
Show Gist options
  • Save 91bananas/787c8d2c3615ba3bab73e842eddf1f73 to your computer and use it in GitHub Desktop.
Save 91bananas/787c8d2c3615ba3bab73e842eddf1f73 to your computer and use it in GitHub Desktop.
The Penguin Virus
import os, sys
from threading import Timer
from random import randrange
def say():
os.system('say -v Princess penguin')
looper()
def looper():
t = Timer(randrange(15), say) # random number between 0 and 14 seconds
t.start()
looper()
# Needs to be run with "$ nohup python <whatever you name the file> &" from whatever directory the file is in, OR with the full path to the file. Then you can close the terminal, it will say that it's going to kill the process but it really won't, that is thanks to nohup
# The added element to make it run whenever a terminal is opened is adding a file, or adding to a pre-existing ~/.bashrc file this line "source <full path to file>", i havent tested it but im about 99% sure that will work
# Sean added this cool idea to the mix today, instead of only saying penguin, have a random switch to decide whether to just say it or have it open a chrome window to some penguin related website.
# We cleverly name this file .D5_Store wherever we put it, idk if you've seen it but on mac computers there is a file .DS_Store in every directory if you open it in finder, this makes it look like it belongs if someone is smart enough to start looking for hidden files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment