如何从包含管道并捕获输出的Python调用shell命令?
假设命令是这样的:
cat file.log | tail -1
Perl相当于我想做的事情就像:
my $string = `cat file.log | tail -1`;
python command-line pipe
command-line ×1
pipe ×1
python ×1