文章详情页
python 利用subprocess库调用mplayer时发生错误
浏览:174日期:2022-09-13 17:22:57
问题描述
脚本在读取stdout时卡住,不再继续执行,也不发生终止
import subprocess p = subprocess.Popen(['mplayer', '-slave', '-quiet', '/home/pi/Music/爱的翅膀.mp3'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell = False) p.stdin.write(’n’) print p.stdout.read() //此处p.stdin.write(’get_time_posn’)print p.stdout.read()
问题解答
回答1:mplayer播放时会向stout输入大量字符,超过了4096造成死锁,输出信息不在我的需求之中,因此决定修改stdout=open('/dev/null','w'),解决问题。参考博客http://blog.csdn.net/imzoer/a...
上一条:python - django在nginx里模板输出html标签问题下一条:python - pandas dataframe如何对某列的空数据位置进行update?update的函数是自定义的,参数是同一行的另外两列数据
相关文章:
排行榜

网公网安备