Skip to content

Instantly share code, notes, and snippets.

@kived
kived / TPython.md
Last active July 3, 2018 10:42
TPython: IPython with a Twisted reactor

Run a Twisted reactor inside IPython.

  1. Copy twist.py to ~/.ipython/twist.py
  2. Copy tpython to ~/bin/tpython
  3. Make tpython executable: chmod +x ~/bin/tpython

You may need to add $HOME/bin to your path.

@leif
leif / timekeeperville.py
Created September 9, 2012 07:42
timekeeperville
"timekeeperville is a game where you must keep time"
# by Leif Ryge, September 2012, WTFPL
from time import time
from collections import deque
results = []
while True:
adj = raw_input("Use default settings? [Yn] ") == "n"
bpm = int(adj and raw_input("Initial BPM? [120] ") or 120)
level = int(adj and raw_input("Initial level? [1] ") or 1 )
limit = int(adj and raw_input("Initial time limit? [15] ") or 15 )