python子进程通过bash与mplayer通信

时间:2016-06-02 07:54:19

标签: python bash python-2.7 subprocess mplayer

我正在运行此代码

#!/usr/bin/env python2.7

cmd = "mplayer -slave -input file=/home/user/mplayer-control duha.mp4 -loop 3000"
import subprocess
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stdin=subprocess.PIPE)
output = process.communicate()[0]

然后在终端我想用echo "pause" > /home/user/mplayer-control暂停mplayer 但是mplayer没有响应我的命令。我做错了什么?

0 个答案:

没有答案