文章详情页
python 利用subprocess库调用mplayer时发生错误
浏览:194日期: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的函数是自定义的,参数是同一行的另外两列数据
相关文章:
1. dockerfile - 为什么docker容器启动不了?2. 对html实现监测 发现不对3. nignx - docker内nginx 80端口被占用4. debian - docker依赖的aufs-tools源码哪里可以找到啊?5. html5 - node静态资源服务器设置了Cache-Control,但浏览器从来不走3046. 关于docker下的nginx压力测试7. 为什么我ping不通我的docker容器呢???8. docker内创建jenkins访问另一个容器下的服务器问题9. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?10. docker镜像push报错
排行榜

网公网安备