>>> import subprocess >>> proc = subprocess.Popen(['ls', '-al'], stdout=subprocess.PIPE) >>> output = proc.stdout.read() >>> print(output) total 3 drwxrwxrwx 1 root root 111111 Sep 11 01:11 dir1 -rwxrwxrwx 1 root root 222222 Nov 22 02:22 file1 -rwxrwxrwx 1 root root 333333 Oct 30 03:33 file2
[Python] 리눅스 쉘 stdout 파이프라인
2017. 11. 13. 17:46