This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| import termios | |
| import sys | |
| import os | |
| proc = '/bin/bash' | |
| # spawn a new process connected to a psuedo-terminal | |
| (pid, master) = os.forkpty() |