Python - subprocess.Popen - ssh -t user@host 'service --status-all'
问题 I've read a bunch of examples but none of them work for this specific task. Python code: x = Popen(commands, stdout=PIPE, stderr=PIPE, shell=True) print commands stdout = x.stdout.read() stderr = x.stderr.read() print stdout, stderr return stdout Output: [user@host]$ python helpers.py ['ssh', '-t', 'user@host', ' ', "'service --status-all'"] usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11] [-i