Frequency Abuse – Python hates your friends
By Raymond Berg on Apr 4, 2010 in humor, programming
I had something fun planned for tonight, but WordPress ate it. You just get the raw bits now.
Basically, use this (amazingly short bit of python code) to wreak havoc on your mate’s computer.
'''
Created on Mar 20, 2010
@author: Raymond
'''
import win32api
import threading
class Beep(threading.Thread):
def __init__(self,frequency,duration):
threading.Thread.__init__(self)
self.frequency = frequency
self.duration = duration
def run(self):
win32api.Beep(self.frequency,self.duration)
for a in range(0,200):
a = Beep(a*20,1000)
a.start()
a.join()
And no, I’m not even white-spacing it for you.
Here’s a fun mp3 (if you’re lazy) with picture of the audacity output. See, no volume change! Only frequency. I love science.
And the exe if you’re lazy and you don’t like to practice safe-computing.