p.stdin.write('\x1bOB')
time.sleep(1)
p.stdin.write('\x1bOB')
time.sleep(1)
p.stdin.write('\x1bOA')
time.sleep(1)
p.stdin.write('\x1bOA')
time.sleep(1)
p.stdin.write('q')
time.sleep(1)
p.stdin.write('y')
How do I interact with a child process pretending to be a terminal?