Skip to content

Instantly share code, notes, and snippets.

from collections import OrderedDict
import re, json, sys, os
def parseObj(tokens):
if(type(tokens) == str):
tokens = re.split(r'[\t\r\n]+', tokens)
tokens.reverse()
obj = OrderedDict()
while len(tokens):
nt = tokens.pop()
@NadnerbD
NadnerbD / Beep.py
Created January 29, 2012 08:50
Hook the terminal using a proxy python script, and send a beep character in response to every keypress
import threading
import termios
import sys
import os
proc = '/bin/bash'
# spawn a new process connected to a psuedo-terminal
(pid, master) = os.forkpty()