16
def __init__(self, command, args=None, timeout=30):
18
self.pid = self.child_fd = None
20
#self.pid, self.child_fd = posix.forkpty()
21
self.pid, self.child_fd = pty.fork()
23
raise Exception('pty fork() failed: ' + str(e))
25
if self.pid == 0: # Child
26
os.execvp(command, args)
35
result = os.read (x.child_fd, 5555)