12 lines
322 B
Python
12 lines
322 B
Python
from subprocess import PIPE, STDOUT, Popen
|
|
from typing import Callable, List, Tuple
|
|
from re import Pattern
|
|
|
|
output_binds: List[Tuple[Pattern, Callable]] = []
|
|
proc = None
|
|
|
|
|
|
def initializeProc(cmd):
|
|
global proc
|
|
proc = Popen(cmd.split(), stdin=PIPE, stdout=PIPE,
|
|
stderr=STDOUT, text=True, bufsize=1)
|