如何使用子进程。通过管道连接多个进程?
subprocess
echo "input data" | awk -f script.awk | sort > outfile.txt
echo
sort
p_awk = subprocess.Popen(["awk","-f","script.awk"], stdin=subprocess.PIPE, stdout=file("outfile.txt", "w"))p_awk.communicate( "input data" )
更新
海绵宝宝撒
catspeake
相关分类