Skip to content

Instantly share code, notes, and snippets.

@amrav
amrav / Zen of Metakgp
Created April 5, 2016 12:04
Zen of Metakgp
Together is better than alone
But beware, for groups cannot be blamed
Consensus trumps authority
And should be won by argument
Surround yourself with your betters
And strive to best them
Ignore what is commonly accepted
Change is wrought through defiant perfection
But shipping beats perfection, every time
@thomasballinger
thomasballinger / subprocess.py
Created December 15, 2013 23:26
Using a pseudo-terminal to interact with interactive Python in a subprocess
from subprocess import Popen, PIPE
import pty
import os
from select import select
import sys
import tty
master, slave = pty.openpty()
p = Popen(['python'], stdin=slave, stdout=PIPE, stderr=PIPE)
pin = os.fdopen(master, 'w')