Issuing commands to psuedo shells (pty)
问题 I've tried to use the subprocess, popen, os.spawn to get a process running, but it seems as though a pseudo terminal is needed. import pty (master, slave) = pty.openpty() os.write(master, "ls -l") Should send "ls -l" to the slave tty... I tried to read the response os.read(master, 1024), but nothing was available. EDIT: Also tried to create pty's, then open the call in a subprocess -- still didn't work. import pty import subprocess (master, slave) = os.openpty() p = subprocess.Popen("ls",